You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
We've found a performance drop in our production code when migrating to node 0.12.
Here is a benchmark that reproduces it:
var keys = ["5613","f9fa","45cb","b7c7","7556","f23b","e697","b75d","efd5","aafe","ca3d","7231","81c6"];
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite;
suite
.add('Object#keys', function() {
var obj = {};
for(var i in keys)
obj[keys[i]] = {};
})
.add('Map#keys', function() {
var map = new Map();
for(var i in keys)
map.set(keys[i], {});
})
.on('cycle', function(event) {
console.log(String(event.target));
})
.run();
On node 0.10.24 (tested on 0.10.38 with similar results)
Object#keys x 216,605 ops/sec ±8.08% (86 runs sampled)
On node 0.12.4 (tested on 0.12.0 with similar results)
Object#keys x 89,854 ops/sec ±2.03% (85 runs sampled)
Map#keys x 331,112 ops/sec ±1.00% (98 runs sampled)
Does object structure has changed drastically in v8 new releases?
Is there something wrong with setting random string names as object keys?
// adding keys to the array worsen the results
keys = keys.concat("ee7a","3c4b","1abd","ad27");
// node 0.10.24 (10% slower)
Object#keys x 198,511 ops/sec ±0.52% (99 runs sampled)
// node 0.12.4 (30% slower)
Object#keys x 64,471 ops/sec ±2.15% (88 runs sampled)
Map#keys x 249,456 ops/sec ±0.98% (97 runs sampled)
The text was updated successfully, but these errors were encountered:
We've found a performance drop in our production code when migrating to node 0.12.
Here is a benchmark that reproduces it:
On node 0.10.24 (tested on 0.10.38 with similar results)
On node 0.12.4 (tested on 0.12.0 with similar results)
Does object structure has changed drastically in v8 new releases?
Is there something wrong with setting random string names as object keys?
The text was updated successfully, but these errors were encountered: