0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/src
Trevor Norris 494227bb03 node: improve GetActiveRequests performance
v8 is faster at setting object properties in JS than C++. Even when it
requires calling into JS from native code. Make
process._getActiveRequests() faster by doing this when populating the
array containing request objects.

Simple benchmark:

    for (let i = 0; i < 22; i++)
      fs.open(__filename, 'r', function() { });
    let t = process.hrtime();
    for (let i = 0; i < 1e6; i++)
      process._getActiveRequests();
    t = process.hrtime(t);
    console.log((t[0] * 1e9 + t[1]) / 1e6);

Results between the two:

    Previous:  4406 ns/op
    Patched:    690 ns/op     5.4x faster

PR-URL: https://github.com/nodejs/node/pull/3375
Reviewed-By: James Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
2015-10-21 16:57:05 -06:00
..
res build,win: fix node.exe resource version 2015-10-01 11:50:51 +01:00
async-wrap-inl.h async_wrap: correctly pass parent to init callback 2015-10-07 13:27:46 -06:00
async-wrap.cc async_wrap: correctly pass parent to init callback 2015-10-07 13:27:46 -06:00
async-wrap.h async_wrap: correctly pass parent to init callback 2015-10-07 13:27:46 -06:00
base-object-inl.h Revert "core: set PROVIDER type as Persistent class id" 2015-05-28 21:48:44 +02:00
base-object.h Revert "core: set PROVIDER type as Persistent class id" 2015-05-28 21:48:44 +02:00
cares_wrap.cc async_wrap: ensure all objects have internal field 2015-10-01 13:56:25 -06:00
CNNICHashWhitelist.inc crypto: add cert check to CNNIC Whitelist 2015-06-16 23:26:29 +09:00
debug-agent.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
debug-agent.h src: switch from QUEUE to intrusive list 2015-02-11 23:06:29 +01:00
env-inl.h async_wrap: correctly pass parent to init callback 2015-10-07 13:27:46 -06:00
env.cc env: introduce KickNextTick 2015-08-26 12:45:16 -07:00
env.h node: improve GetActiveRequests performance 2015-10-21 16:57:05 -06:00
fs_event_wrap.cc src: Add ABORT macro 2015-09-17 15:25:14 -05:00
handle_wrap.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
handle_wrap.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
js_stream.cc js_stream: prevent abort if isalive doesn't exist 2015-10-08 11:38:21 -06:00
js_stream.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_buffer.cc buffer: fix assertion error in WeakCallback 2015-10-12 20:47:10 -07:00
node_buffer.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_constants.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_constants.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_contextify.cc vm: remove Watchdog dependency on Environment 2015-10-21 00:34:53 +02:00
node_counters.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_counters.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_crypto_bio.cc src: Add ABORT macro 2015-09-17 15:25:14 -05:00
node_crypto_bio.h src: fix crypto bio integer wraparound on 32 bits 2015-03-18 20:06:20 +01:00
node_crypto_clienthello-inl.h Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
node_crypto_clienthello.cc build,src: remove sslv3 support 2015-01-13 01:59:30 +01:00
node_crypto_clienthello.h Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
node_crypto_groups.h Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
node_crypto.cc tls: output warning of setDHParam to console.trace 2015-10-16 11:40:05 +09:00
node_crypto.h tls: add TLSSocket.getEphemeralKeyInfo() 2015-10-16 11:39:45 +09:00
node_dtrace.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_dtrace.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_file.cc src: fix u-a-free if uv returns err in ASYNC_CALL 2015-10-08 19:25:47 +02:00
node_file.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_http_parser.cc http: fix stalled pipeline bug 2015-10-14 12:16:18 -04:00
node_http_parser.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_i18n.cc Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
node_i18n.h src: hide InitializeICUDirectory symbol 2015-06-02 21:44:18 +02:00
node_internals.h src: null env_ field from constructor 2015-09-16 12:48:25 -06:00
node_javascript.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_javascript.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_lttng_provider.h lttng: update flags for gc tracing 2015-10-20 23:38:28 +02:00
node_lttng_tp.h tracing: add lttng support for tracing on linux 2015-02-09 18:06:57 +01:00
node_lttng.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_lttng.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_main.cc Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
node_object_wrap.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_os.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_provider.d src: remove unused dtrace probes 2015-02-02 21:55:56 +01:00
node_root_certs.h crypto: update root certificates 2015-06-02 19:28:14 +02:00
node_stat_watcher.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_stat_watcher.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_util.cc util: fix for inspecting promises 2015-10-06 16:19:55 -05:00
node_v8.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node_version.h src: bump NODE_MODULE_VERSION To 47 2015-10-20 23:11:07 -04:00
node_watchdog.cc vm: remove Watchdog dependency on Environment 2015-10-21 00:34:53 +02:00
node_watchdog.h vm: remove Watchdog dependency on Environment 2015-10-21 00:34:53 +02:00
node_win32_etw_provider-inl.h dtrace: fix removal of unused probes 2015-02-03 22:37:42 +11:00
node_win32_etw_provider.cc Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
node_win32_etw_provider.h src: remove unused dtrace probes 2015-02-02 21:55:56 +01:00
node_win32_perfctr_provider.cc Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
node_win32_perfctr_provider.h Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
node_wrap.h stream_base: various improvements 2015-08-20 01:14:37 -07:00
node_zlib.cc zlib: decompression throw on truncated input 2015-10-19 15:06:05 -06:00
node.cc node: improve GetActiveRequests performance 2015-10-21 16:57:05 -06:00
node.d
node.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
node.js node: improve GetActiveRequests performance 2015-10-21 16:57:05 -06:00
node.stp src: remove unused dtrace probes 2015-02-02 21:55:56 +01:00
nolttng_macros.py tracing: add lttng support for tracing on linux 2015-02-09 18:06:57 +01:00
notrace_macros.py src: remove unused dtrace probes 2015-02-02 21:55:56 +01:00
perfctr_macros.py
pipe_wrap.cc async_wrap: update providers and add test 2015-10-01 13:54:44 -06:00
pipe_wrap.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
process_wrap.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
req-wrap-inl.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
req-wrap.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
signal_wrap.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
spawn_sync.cc src: Add ABORT macro 2015-09-17 15:25:14 -05:00
spawn_sync.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
stream_base-inl.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
stream_base.cc http: fix out-of-order 'finish' bug in pipelining 2015-10-06 07:02:20 +11:00
stream_base.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
stream_wrap.cc stream_wrap: support empty TryWrites 2015-10-06 07:02:21 +11:00
stream_wrap.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
string_bytes.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
string_bytes.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
string_search.cc src: replace naive search in Buffer::IndexOf 2015-10-07 21:09:53 -07:00
string_search.h src: replace naive search in Buffer::IndexOf 2015-10-07 21:09:53 -07:00
tcp_wrap.cc async_wrap: update providers and add test 2015-10-01 13:54:44 -06:00
tcp_wrap.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
timer_wrap.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
tls_wrap.cc src: Add ABORT macro 2015-09-17 15:25:14 -05:00
tls_wrap.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
tree.h
tty_wrap.cc src: Add ABORT macro 2015-09-17 15:25:14 -05:00
tty_wrap.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
udp_wrap.cc async_wrap: update providers and add test 2015-10-01 13:54:44 -06:00
udp_wrap.h src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
util-inl.h deps: update v8 to 4.4.63.9 2015-08-04 11:56:14 -07:00
util.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
util.h src: include signal.h in util.h 2015-09-25 14:25:21 +02:00
uv.cc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
v8abbr.h v8abbr: ASCIISTRINGTAG => ONEBYTESTRINGTAG 2015-02-03 19:25:31 +03:00
v8ustack.d dtrace: backport two byte string fix 2013-10-09 08:49:39 -07:00