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
We've found a performance drop in our production code when migrating to node 0.12.
Here is a benchmark that reproduces it (based on the readme sample):
varkdtree=require('./kdtree');// an npm module would be awesome ;-)varBenchmark=require('benchmark');varpoints=[{x: 1,y: 2},{x: 3,y: 4},{x: 5,y: 6},{x: 7,y: 8}];vardistance=function(a,b){returnMath.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2);}vartree=newkdTree(points,distance,["x","y"]);varsuite=newBenchmark.Suite();suite.add('Tree#nearest',function(){tree.nearest({x: 5,y: 5},2);}).on('cycle',function(event){console.log(String(event.target));}).run({'async': true});
On node 0.10.24 (tested on 0.10.39 with similar results)
Tree#nearest x 321,548 ops/sec ±1.68% (92 runs sampled)
On node 0.12.6 (tested on 0.12.0 with similar results)
Tree#nearest x 82,008 ops/sec ±3.13% (75 runs sampled)
Any idea on the matter?
The text was updated successfully, but these errors were encountered:
We've been reviewing our code for the big jump to 0.12 and we've not found any global performance drop. Several things may seem slower (accessing or assigning object for instance) but this is more related to micro benchmark (in the cases we've found so far). On the other hand, there is some real performance boost as well.
Creating objects and arrays seems more expensive (in heavy algorithm mainly), but it seems that manipulating data is faster than ever.
I'm sorry that I cannot be more precise on a recipe to boost an algorithm for 0.12, I don't know any.
It seems that a lot of libraries are not affected be this shift, but, for the others (uglify has a similar issue) solutions remain to be found.
We've found a performance drop in our production code when migrating to node 0.12.
Here is a benchmark that reproduces it (based on the readme sample):
On node 0.10.24 (tested on 0.10.39 with similar results)
On node 0.12.6 (tested on 0.12.0 with similar results)
Any idea on the matter?
The text was updated successfully, but these errors were encountered: