TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Node.js module performance

46 点作者 sorenso大约 10 年前

8 条评论

antouank大约 10 年前
Tried it on 0.10.36 , 0.12 and io.js 1.4.3 to see difference between node versions. Almost identical results, except for v2, which has a huge difference... <a href="https://gist.github.com/AntouanK/ab089b3380a7ff73b8f7" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;AntouanK&#x2F;ab089b3380a7ff73b8f7</a>
评论 #9138230 未加载
brwnll大约 10 年前
Am I incorrect in my normal usage of &quot;x&quot; when conveying relative performance? With 120.8498 vs 120.4320 being conveyed as &quot;1.00 x slower&quot;. Is this the correct terminology for results that are on par with each other? Really, these results are (relatively) unchanged. Shouldn&#x27;t it be 0.003x slower, with the formula being (Old &#x2F; New) - 1.<p>From the page:<p>Result Node.js v0.12.0<p>Called v2, util.yo(&quot;man&quot;) 100.000.000.000 times in 120.849870219 sec (1.00 x slower than v3)<p>Called v3, util.yo(&quot;man&quot;) 100.000.000.000 times in 120.432087601 sec
评论 #9140393 未加载
PSeitz大约 10 年前
Calling prototype functions directly from the constructor function instead on the objects doesn&#x27;t make much sense. So I&#x27;m not sure how to value the results.
评论 #9138098 未加载
sorenso大约 10 年前
If you want, you can run these test yourself: <a href="https://github.com/5orenso/javascript-module-performance" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;5orenso&#x2F;javascript-module-performance</a><p>I&#x27;ll then present the results on a nice webpage :)
jsnoi大约 10 年前
v2 uses shared opt object, so using another new utils(opt) will override your previous options.
评论 #9138082 未加载
arenaninja大约 10 年前
Extremely educational, thanks.<p>I started using Node for some things where PHP feels inadequate (async network requests), and overall I&#x27;m happy with the speed, but after years of PHP it&#x27;s been rough figuring out the right way to do objects. I don&#x27;t need nearly this many requests, but I find it useful to internalize micro-optimizations to make your code a speed demon
评论 #9139116 未加载
couchand大约 10 年前
Is the call to console.log really there in the benchmarked version 3?
评论 #9138052 未加载
stupidcar大约 10 年前
I don&#x27;t get it. Why would you care about the performance of your module boilerplate?
评论 #9138073 未加载