node-lessons icon indicating copy to clipboard operation
node-lessons copied to clipboard

benchmark结果不同

Open Happy-xiaoxi opened this issue 7 years ago • 4 comments

同样的代码,为什么我一直运行的是+最快,是因为node和浏览器运行方式不一样的缘故吗? + x 67,830,632 ops/sec ±2.27% (82 runs sampled) parseInt x 48,760,129 ops/sec ±2.45% (77 runs sampled)
Number x 51,682,803 ops/sec ±7.15% (65 runs sampled) Fastest is +

Happy-xiaoxi avatar Feb 14 '17 15:02 Happy-xiaoxi

这issue对应哪个lesson?

2017-02-14 23:05 GMT+08:00 xiaoC [email protected]:

同样的代码,为什么我一直运行的是+最快,是因为node和浏览器运行方式不一样的缘故吗?

  • x 67,830,632 ops/sec ±2.27% (82 runs sampled) parseInt x 48,760,129 ops/sec ±2.45% (77 runs sampled) Number x 51,682,803 ops/sec ±7.15% (65 runs sampled) Fastest is +

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alsotang/node-lessons/issues/123, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGB74oEBOFy37SazhGx9T0SrTE4dkoGks5rccKwgaJpZM4MAlTy .

-- GitHub: https://github.com/alsotang

alsotang avatar Feb 15 '17 03:02 alsotang

哦,抱歉,这个是lesson10 的内容

Happy-xiaoxi avatar Feb 15 '17 03:02 Happy-xiaoxi

可能当时 node 0.12 版本跟现在的版本有差异吧。

https://github.com/alsotang/fast-js 根据我这里的数据来看,+会更快。

alsotang avatar Feb 15 '17 06:02 alsotang

好的,谢谢,我还以为自己弄错了点什么 ^^

Happy-xiaoxi avatar Feb 15 '17 07:02 Happy-xiaoxi