mirror of https://github.com/lukechilds/node.git
Browse Source
Creating an object in JS and using a typed array to transfer values from C++ to JS is faster than creating an object and setting properties in C++. The included benchmark shows ~34% increase in performance with this change. PR-URL: https://github.com/nodejs/node/pull/11497 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>v6.x
committed by
Myles Borins
5 changed files with 46 additions and 21 deletions
@ -0,0 +1,16 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
var common = require('../common.js'); |
||||
|
var bench = common.createBenchmark(main, { |
||||
|
n: [1e5] |
||||
|
}); |
||||
|
|
||||
|
function main(conf) { |
||||
|
var n = +conf.n; |
||||
|
|
||||
|
bench.start(); |
||||
|
for (var i = 0; i < n; i++) { |
||||
|
process.memoryUsage(); |
||||
|
} |
||||
|
bench.end(n); |
||||
|
} |
Loading…
Reference in new issue