Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unify cancelation: #226

Open
stefanpenner opened this issue May 22, 2017 · 8 comments
Open

unify cancelation: #226

stefanpenner opened this issue May 22, 2017 · 8 comments

Comments

@stefanpenner
Copy link
Collaborator

https://github.com/BackburnerJS/backburner.js/blob/master/lib/backburner/queue.ts#L139-L180

rather then doing splicing lets just null out always

@bekzod thoughts?

@bekzod
Copy link
Contributor

bekzod commented May 23, 2017

sounds good I think, splice has performance implications as I have heard (haven't benchmarked myself) also cancel is not frequently used method

@bekzod
Copy link
Contributor

bekzod commented May 23, 2017

surprise surprise #227
I will let benchmark to speak to itself

Cancel - no timer ............................................................... 29,767,632.00 op/s
Schedule & Cancel - function ........................................................ 30,406.16 op/s
Schedule & Cancel - target, function ................................................ 36,787.48 op/s
Schedule & Cancel - target, string method name ...................................... 29,762.83 op/s
Schedule & Cancel - target, string method name, 1 argument .......................... 50,260.97 op/s
Schedule & Cancel - target, string method name, 2 arguments ......................... 42,101.87 op/s
Schedule & Cancel - prescheduled, same queue - target, string method name ........... 76,889.89 op/s
Schedule & Cancel - prescheduled, separate queue - target, string method name ....... 83,361.58 op/s

@bekzod
Copy link
Contributor

bekzod commented May 23, 2017

this is current master
Cancel - no timer ............................................................... 64,863,814.30 op/s
Schedule & Cancel - function ..................................................... 3,190,839.04 op/s
Schedule & Cancel - target, function ............................................. 3,049,007.76 op/s
Schedule & Cancel - target, string method name ................................... 3,273,669.80 op/s
Schedule & Cancel - target, string method name, 1 argument ....................... 3,189,777.45 op/s
Schedule & Cancel - target, string method name, 2 arguments ...................... 3,033,343.78 op/s
Schedule & Cancel - prescheduled, same queue - target, string method name ........ 1,074,390.96 op/s

@stefanpenner
Copy link
Collaborator Author

oh wait, i think I misread this.

@stefanpenner stefanpenner reopened this May 23, 2017
@bekzod
Copy link
Contributor

bekzod commented May 23, 2017

sorry first time i was excited too early too without checking current master benchmark

@stefanpenner
Copy link
Collaborator Author

Im surprised that #227 regresses so much.

@stefanpenner
Copy link
Collaborator Author

Ah, i wonder if it is actually a realistic example. It could be that in benchmark land without the splice we keep growing the array, and with who do not. But in reality that may not be a problem?

Likely warrants further investigation

@bekzod
Copy link
Contributor

bekzod commented May 23, 2017

in real case maybe cancel will not be called that much as in benchmark and will have better results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants