0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/lib
Anatoli Papirovski f61cc15c6a
events: stricter prop & variable checks for perf
Replace truthy/falsey checks of _events and _events[type] with
comparisons to undefined for better performance:

events/ee-add-remove.js n=250000    5.30 %    *** 4.260028e-07
events/ee-emit.js n=2000000         4.18 %    *** 1.026649e-05

This has a knock-on effect on modules that use lots of events, e.g.:

http2/headers.js nheaders=0 n=1000  2.60 %    *** 0.000298338

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:26:18 -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
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
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: stricter prop & variable checks for perf 2017-10-21 09:26:18 -04:00
fs.js tools: enable additional eslint rules 2017-10-19 13:54:14 -04:00
http2.js
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
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