0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/lib
Anatoli Papirovski d5fb78982a
events: use spread function param in emit
With recent changes in V8, it is now as performant or faster to use
spread parameter within EventEmitter.prototype.emit, especially
in cases where looping over arguments is required.

events/ee-emit.js n=2000000               4.40 %    *** 1.505543e-06
events/ee-emit-1-arg.js n=2000000         2.16 %    *** 2.434584e-10
events/ee-emit-2-args.js n=2000000        1.05 %     ** 0.001764852
events/ee-emit-3-args.js n=2000000        2.18 %    *** 3.234954e-08
events/ee-emit-6-args.js n=2000000       17.17 %    *** 1.298702e-103
events/ee-emit-10-args.js n=2000000      17.14 %    *** 1.144958e-97

This has a knock-on effect for modules that use events extensively,
such as http2:

http2/headers.js nheaders=0 n=1000        2.10 %    *** 6.792106e-11

PR-URL: https://github.com/nodejs/node/pull/16212
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-10-21 09:28:42 -04:00
..
internal lib: move duplicate spliceOne into internal/util 2017-10-20 15:51:20 -04:00
_http_agent.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
_http_client.js http: emit close as the last event in the client 2017-10-18 15:56:19 +02:00
_http_common.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
_http_incoming.js tools: enable additional eslint rules 2017-10-19 13:54:14 -04:00
_http_outgoing.js tools: enable additional eslint rules 2017-10-19 13:54:14 -04:00
_http_server.js tools: enable additional eslint rules 2017-10-19 13:54:14 -04:00
_stream_duplex.js
_stream_passthrough.js
_stream_readable.js tools: enable additional eslint rules 2017-10-19 13:54:14 -04:00
_stream_transform.js stream: migrate to internal/errors 2017-10-01 20:37:00 -03:00
_stream_wrap.js lib: move _stream_wrap into internals 2017-10-19 18:06:27 +02:00
_stream_writable.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
_tls_common.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
_tls_legacy.js tools: enable additional eslint rules 2017-10-19 13:54:14 -04:00
_tls_wrap.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
.eslintrc.yaml tools: remove legacy indentation linting 2017-07-30 09:21:52 -07:00
assert.js lib: faster type checks for some types 2017-10-01 23:58:59 -03:00
async_hooks.js async_hooks: skip runtime checks when disabled 2017-10-19 12:45:21 +02:00
buffer.js lib: faster type checks for some types 2017-10-01 23:58:59 -03:00
child_process.js tools: enable additional eslint rules 2017-10-19 13:54:14 -04:00
cluster.js
console.js console: improve console.group() 2017-08-25 11:29:33 -07:00
constants.js src: add support to pass flags to dlopen 2017-09-08 17:14:03 -04:00
crypto.js crypto: make createXYZ inlineable 2017-10-09 11:40:13 +02:00
dgram.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
dns.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
domain.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
events.js events: use spread function param in emit 2017-10-21 09:28:42 -04:00
fs.js tools: enable additional eslint rules 2017-10-19 13:54:14 -04:00
http2.js http2: refactor error handling 2017-08-28 00:39:42 +04:00
http.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
https.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
inspector.js inspector: migrate to internal/errors 2017-10-16 09:31:18 -07:00
module.js lib: fix extraneous space in module.js 2017-10-19 08:59:45 -04:00
net.js lib: refactor wrap_js_stream for ES6/readability 2017-10-19 18:06:27 +02:00
os.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
path.js tools: enable additional eslint rules 2017-10-19 13:54:14 -04:00
perf_hooks.js perf_hooks: implementation of the perf timing API 2017-08-23 16:00:09 -07:00
process.js
punycode.js
querystring.js tools: enable additional eslint rules 2017-10-19 13:54:14 -04:00
readline.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
repl.js repl: deprecate REPLServer.prototype.memory 2017-10-19 14:58:26 -04:00
stream.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
string_decoder.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
sys.js
timers.js timers: fix eventloop block 2017-10-18 11:59:11 -07:00
tls.js lib: faster type checks for some types 2017-10-01 23:58:59 -03:00
tty.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
url.js lib: move duplicate spliceOne into internal/util 2017-10-20 15:51:20 -04:00
util.js util: use faster -0 check 2017-10-04 03:51:44 -04:00
v8.js
vm.js vm: support parsing a script in a specific context 2017-09-05 10:47:42 +08:00
zlib.js zlib: migrate to internal/errors 2017-10-02 12:36:52 -07:00