node: improve nextTick performance
authorBrian White <mscdex@mscdex.net>
Fri, 1 May 2015 18:08:02 +0000 (14:08 -0400)
committerBrian White <mscdex@mscdex.net>
Sat, 2 May 2015 01:27:34 +0000 (21:27 -0400)
commitc7782c0af8a4e4ee26da6e44e07c3987d9d3ddb6
treec34ab5332254a02afdfa73476c5ce742da981dca
parentea5195ccaf6d51262c9089c2ec5c6f5634bc12b5
node: improve nextTick performance

This commit uses separate functions to isolate deopts caused by
try-catches and avoids fn.apply() for callbacks with small numbers
of arguments.

These changes improve performance by ~1-40% in the various
nextTick benchmarks.

PR-URL: https://github.com/iojs/io.js/pull/1571
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
benchmark/misc/next-tick-breadth-args.js [new file with mode: 0644]
benchmark/misc/next-tick-depth-args.js [new file with mode: 0644]
src/node.js
test/message/nexttick_throw.out
test/message/stdin_messages.out