0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test
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
..
abort src: honor --abort_on_uncaught_exception flag 2015-09-17 15:25:25 -05:00
addons buffer: fix assertion error in WeakCallback 2015-10-12 20:47:10 -07:00
cctest
debugger test: load common.js in all tests 2015-10-06 15:11:47 -07:00
disabled test: replace deprecated util.debug() calls 2015-09-28 11:15:06 -07:00
fixtures util: Remove p, has been deprecated for years 2015-10-19 20:52:56 +02:00
gc src: replace usage of v8::Handle with v8::Local 2015-09-06 21:38:05 +10:00
internet test: skip test-dns-ipv6.js if ipv6 is unavailable 2015-10-20 12:07:22 -07:00
message test: remove flaky status from eval_messages test 2015-10-20 12:16:00 -07:00
parallel node: improve GetActiveRequests performance 2015-10-21 16:57:05 -06:00
pummel test: change calls to deprecated util.print() 2015-09-28 13:21:15 -07:00
sequential test: fix flaky test-child-process-emfile 2015-10-20 15:41:37 -07:00
testpy test: fix default value for additional param 2015-09-15 19:59:38 +05:30
timers test: enable linting for tests 2015-05-19 21:21:27 +02:00
.eslintrc test: make common.js mandatory via linting rule 2015-10-06 15:11:58 -07:00
common.js test: remove util from common 2015-10-12 21:08:53 -07:00