diff options
author | Brian White <mscdex@mscdex.net> | 2015-02-05 15:35:33 -0500 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-02-09 17:47:49 +0100 |
commit | b677b844fc1de328a0f2b0151bdfc045cb5d0c81 (patch) | |
tree | 395cbae33a97b380077ead592ca95aad6d6076e0 /test/message/stdin_messages.out | |
parent | c86e383c41f35b17ba79cc1c6dbfff674214177d (diff) | |
download | android-node-v8-b677b844fc1de328a0f2b0151bdfc045cb5d0c81.tar.gz android-node-v8-b677b844fc1de328a0f2b0151bdfc045cb5d0c81.tar.bz2 android-node-v8-b677b844fc1de328a0f2b0151bdfc045cb5d0c81.zip |
events: optimize various functions
Cache events and listeners objects where possible and loop over
Object.keys() instead of using for..in. These changes alone give
~60-65% improvement in the ee-add-remove benchmark.
The changes to EventEmitter.listenerCount() gives ~14%
improvement and changes to emitter.listeners() gives
significant improvements for <50 listeners
(~195% improvement for 10 listeners).
The changes to emitter.emit() gives 3x speedup for the fast
cases with multiple handlers and a minor speedup for the slow
case with multiple handlers.
The swapping out of the util.is* type checking functions with inline
checks gives another ~5-10% improvement.
PR-URL: https://github.com/iojs/io.js/pull/601
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Diffstat (limited to 'test/message/stdin_messages.out')
-rw-r--r-- | test/message/stdin_messages.out | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/message/stdin_messages.out b/test/message/stdin_messages.out index de9da7f04c..5c0d86a36b 100644 --- a/test/message/stdin_messages.out +++ b/test/message/stdin_messages.out @@ -9,6 +9,7 @@ SyntaxError: Strict mode code may not include a with statement at Module._compile (module.js:*:*) at evalScript (node.js:*:*) at Socket.<anonymous> (node.js:*:*) + at emitNone (events.js:*:*) at Socket.emit (events.js:*:*) at _stream_readable.js:*:* at process._tickCallback (node.js:*:*) @@ -25,6 +26,7 @@ Error: hello at Module._compile (module.js:*:*) at evalScript (node.js:*:*) at Socket.<anonymous> (node.js:*:*) + at emitNone (events.js:*:*) at Socket.emit (events.js:*:*) at _stream_readable.js:*:* at process._tickCallback (node.js:*:*) @@ -39,6 +41,7 @@ Error: hello at Module._compile (module.js:*:*) at evalScript (node.js:*:*) at Socket.<anonymous> (node.js:*:*) + at emitNone (events.js:*:*) at Socket.emit (events.js:*:*) at _stream_readable.js:*:* at process._tickCallback (node.js:*:*) @@ -54,6 +57,7 @@ ReferenceError: y is not defined at Module._compile (module.js:*:*) at evalScript (node.js:*:*) at Socket.<anonymous> (node.js:*:*) + at emitNone (events.js:*:*) at Socket.emit (events.js:*:*) at _stream_readable.js:*:* at process._tickCallback (node.js:*:*) |