-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
3x faster setImmediate #6436
3x faster setImmediate #6436
Commits on Apr 28, 2016
-
timers: linkedlist optimizations
use L.create() factory to create access-optimized linkedlist objects
Andras committedApr 28, 2016 Configuration menu - View commit details
-
Copy full SHA for 44243ad - Browse repository at this point
Copy the full SHA 44243adView commit details -
timers: 3x faster setImmediate
Save the setImmediate callback arguments into an array instead of a closure, and invoke the callback on the arguments from an optimizable function. 60% faster setImmediate with 0 args (15% if self-recursive) 4x faster setImmediate with 1-3 args, 2x with > 3 seems to be faster with less memory pressure when memory is tight Changes: - use L.create() to build faster lists - use runCallback() from within tryOnImmediate - create immediate timers with a function instead of new - just save the arguments and not build closures for the callbacks
Andras committedApr 28, 2016 Configuration menu - View commit details
-
Copy full SHA for d005b81 - Browse repository at this point
Copy the full SHA d005b81View commit details -
timers: 3x faster clearImmediate
Instead of unlinking from the immediate queue immediate on clear, put off the unlink until processImmediate where it's more efficient. 3x faster clearImmediate processing The the benefits stack with the setImmediate speedups, ie total gain of 3.5x with 0 arguments and 4-5x with 1-3 args. Changed the code to defer unlinking from the immediate queue until processImmediate consumes the queue anyway.
Andras committedApr 28, 2016 Configuration menu - View commit details
-
Copy full SHA for ad3bcb8 - Browse repository at this point
Copy the full SHA ad3bcb8View commit details -
timers: setImmediate benchmarks
Timings for sequential and concurren setImmediate with and without arguments, and set + clearImmediate.
Andras committedApr 28, 2016 Configuration menu - View commit details
-
Copy full SHA for 1f82a29 - Browse repository at this point
Copy the full SHA 1f82a29View commit details -
Andras committed
Apr 28, 2016 Configuration menu - View commit details
-
Copy full SHA for 49b2611 - Browse repository at this point
Copy the full SHA 49b2611View commit details -
timers: code review edits (two-arg createImmediate)
Andras committedApr 28, 2016 Configuration menu - View commit details
-
Copy full SHA for c12ba47 - Browse repository at this point
Copy the full SHA c12ba47View commit details
Commits on Apr 29, 2016
-
Andras committed
Apr 29, 2016 Configuration menu - View commit details
-
Copy full SHA for 6dcbd83 - Browse repository at this point
Copy the full SHA 6dcbd83View commit details
Commits on May 1, 2016
-
timers: create immediate objects with new Immediate()
Andras committedMay 1, 2016 Configuration menu - View commit details
-
Copy full SHA for 197aac2 - Browse repository at this point
Copy the full SHA 197aac2View commit details
Commits on May 2, 2016
-
timers: speed up another 2x setImmediate() with > 3 args
220% faster yet setImmediate with 4 args, 240% with 5, 260% with 6 Changed the code to copy arguments into a dynamically extended array instead of preallocating the exact size. It seems f.apply(obj, args) runs much faster in node v6 if the args array was extended at run-time as opposed to preallocated the correct size. This behavior is new in node v6.0.0; v5.10.1 was 4x faster to apply an args array created the exact size. (Node v5 and v4 were the other way around, faster to .apply static sized arrays, and slower if dynamically grown.) // faster to copy args, but v6 slow to .apply them: var argv = new Array(arguments.length - 1); // exact size for (var i = 1; i < arguments.length; i++) argv[i - 1] = arguments[i]; // slower to copy args, but v6 much faster to .apply them: var argv = new Array(); // grow as needed for (var i = 1; i < arguments.length; i++) argv[i - 1] = arguments[i];
Andras committedMay 2, 2016 Configuration menu - View commit details
-
Copy full SHA for 4b54cd7 - Browse repository at this point
Copy the full SHA 4b54cd7View commit details
Commits on May 6, 2016
-
Andras committed
May 6, 2016 Configuration menu - View commit details
-
Copy full SHA for 8179d32 - Browse repository at this point
Copy the full SHA 8179d32View commit details -
Andras committed
May 6, 2016 Configuration menu - View commit details
-
Copy full SHA for 77e0443 - Browse repository at this point
Copy the full SHA 77e0443View commit details
Commits on May 7, 2016
-
code review edits (comment less obvious parts of code)
Andras committedMay 7, 2016 Configuration menu - View commit details
-
Copy full SHA for 0e75f1f - Browse repository at this point
Copy the full SHA 0e75f1fView commit details