backburner.js
backburner.js copied to clipboard
unify cancelation:
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?
sounds good I think, splice has performance implications as I have heard (haven't benchmarked myself) also cancel is not frequently used method
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
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
oh wait, i think I misread this.
sorry first time i was excited too early too without checking current master benchmark
Im surprised that #227 regresses so much.
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
in real case maybe cancel will not be called that much as in benchmark and will have better results