-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const
performance loss ? Node 6 vs Node 7
#10516
Comments
Here is my result on Node.js 7.3.0 (Windows 7 x64) with the original test:
Here is my result on Node.js 7.3.0 with the
/******************************************************************************/
'use strict';
/******************************************************************************/
const functions = [
function testNum() { return 1 + 2; },
function testVar() { var a = 1; var b = 2; return a + b; },
function testLet() { let a = 1; let b = 2; return a + b; },
function testConst() { const a = 1; const b = 2; return a + b; },
];
/******************************************************************************/
const suite = require('benchmark').Suite();
functions.forEach((func) => { suite.add(func.name, func); });
suite.on('cycle', (evt) => { console.log(String(evt.target)); }).run({ async: false });
/******************************************************************************/ The result is:
#9729 |
@vsemozhetbyt Thanks for your reply !
Here are my results with a sum initialized version on the test :
ctl = {"min":31,"max":47,"mean":32.18,"spread":2.558827856656222}
con = {"min":31,"max":32,"mean":31.62,"spread":0.48538644398032277}
var = {"min":31,"max":32,"mean":31.6,"spread":0.48989794855652885}
ctl = {"min":31,"max":45,"mean":32.24,"spread":2.2410711724529935}
con = {"min":31,"max":32,"mean":31.68,"spread":0.46647615158768974}
var = {"min":31,"max":33,"mean":31.78,"spread":0.45999999999985014} Everything comes back in order. 2 & 3. Thanks for this code/results example and the references ! I'll close this topic by the end of the day if nobody wants to say something more. P.S : I'm still curious to know why the |
I just tried a simple
var
vsconst
benchmark https://gist.github.com/srikumarks/1431640Results :
What could explain this
con.spread
evolution ?This benchmark is maybe not reliable, but if it is, there's probably something to fix.
The text was updated successfully, but these errors were encountered: