性能对决:Node.js vs io.js v2.0.0 已翻译 100%

oschina 投递于 2015/05/12 14:54 (共 6 段, 翻译完成于 05-14)
阅读 9936
收藏 47
4
加载中

We noted with some interest the recent announcement of the io.js v2.0.0 release candidate. This community fork of node.js promises a supported version of the V8 engine, along with a greatly increased frequency of commits to master vs. the parent project.

As we’ve mentioned before, we’re keen on these developments as Node.js powers the Raygun API nodes, and ensuring these can handle the highest loads with the lowest possible response times is crucial to providing a great service to our users. A previous blog post benchmarked Node.js vs. io.js, and with the advent of the V2 release of the latter, we’d like to revisit those benchmarks to see how it stacks up in various situations.

node-vs-io 2

已有 1 人翻译此段
我来翻译

The set up

Same as before, the following are synthetic micro-benchmarks, caveat emptor, huge grain of salt, etc. However, the charts do provide some interesting food for thought, and may provide a springboard for you to perform your own real-world tests, and potentially gain a significant speedup.

The benchmarks were conducted with identical runs through ApacheBench on a 64-bit Ubuntu VM. The configuration was 20,000 requests with a concurrency level of 100, and the test results were averaged over five runs of this.

We benchmarked two versions of node, and two versions of io.js. For node, v0.10.38 (the last release of the .10 branch) was compared against v0.12.2 (the absolute latest version of node.js).

For io.js, we compared v1.8.1, the last release on the 1.x branch against the newest v2.0.0 release.

已有 1 人翻译此段
我来翻译

Raw JSON response

This test involved created a simple server with the http module, and setting it to return a JSON payload on request. The results were:

1

What is interesting to note is the performance drop from node 0.10 to 0.12, which io.js corrects on the 1.x branch – but then dominates with v2.0.0.

When sending a raw response, in this benchmark io.js v2.0.0 has a 14% speedup over node 0.12! They’ve even managed a 5% speedup over their own previous release. Not bad at all, but there’s more we can test.

已有 2 人翻译此段
我来翻译

Express.js

Express was and is still a very popular choice for quickly getting the backend of a web application up and running. Last time we documented some of the performance hit you take with it, but let’s see how it does under node 0.12 vs io.js v2.0.0:

2

There’s a 4.5% speedup when running this test on io.js v2.0.0 – pretty good for an older framework (considering how fast the JS ecosystem is moving)!

已有 2 人翻译此段
我来翻译

Koa.js on Node vs io.js

Many newer frameworks are competing for mindshare in the JS micro web framework space, however – we benchmarked some popular ones previously. One which we missed was Koa.js, which was in fact made by the authors of Express.js.

One of the huge benefits with Koa is that you can build code using ES6 features – including generators and the yield syntax which enable asynchronous code (no more callback hell). This benchmark was written using generators and run with the node --harmony flag enabled. The logic involved a simple bit of routing, and set the response to be an HTML fragment.

已有 1 人翻译此段
我来翻译

Let’s see how Koa does running on Node vs. io.js:

3-2

A 14.8% speedup from Node to the latest version of io.js – certainly worthy of note. If you’re looking at one of the latest generation of JS backend frameworks, it certainly pays to give io.js a look as out-of-the-box you get some rather impressive perf improvements. When running a cluster of VMs using the Node stack, depending on scale, that speedup may result in several fewer boxes needed and correspondingly less infrastructure costs – all for free.

We do error tracking

We love perf improvements here at Raygun, so if you have any experience running io.js or Node in production feel free to post in the comments. We also have a kickass Node error tracking implementation – there’s a free 30-day trial available here. Keep improving that perf, and blasting those errors!

已有 1 人翻译此段
我来翻译
本文中的所有译文仅用于学习和交流目的,转载请务必注明文章译者、出处、和本文链接。
我们的翻译工作遵照 CC 协议,如果我们的工作有侵犯到您的权益,请及时联系我们。
加载中

评论(29)

incca
incca

引用来自“周星星”的评论

图表有点坑
同感
我的ID是jmjoy
我的ID是jmjoy
乌龟和乌龟比赛跑
高耳鸡
高耳鸡

引用来自“大猛0403”的评论

不是说要合并了么

引用来自“开源中国匿名会员”的评论

不是已经开始合并了吗: Node.js Foundation - node.js & io.js Convergence https://github.com/jasnell/dev-policy https://github.com/nodejs/node

引用来自“Raphael_goh”的评论

你确定能打开?

引用来自“开源中国匿名会员”的评论

打不开我发上来干啥。我又不是 @eechen ,百度出来不带验证就贴的人。
你和他什么仇什么怨😳
高耳鸡
高耳鸡

引用来自“大猛0403”的评论

不是说要合并了么

引用来自“开源中国匿名会员”的评论

不是已经开始合并了吗: Node.js Foundation - node.js & io.js Convergence https://github.com/jasnell/dev-policy https://github.com/nodejs/node

引用来自“Raphael_goh”的评论

你确定能打开?

引用来自“vivid”的评论

骚年,这里是天朝

引用来自“牛仔豆”的评论

能打开
联通打开挺快的,公司电信打不开
牛仔豆
牛仔豆

引用来自“大猛0403”的评论

不是说要合并了么

引用来自“开源中国匿名会员”的评论

不是已经开始合并了吗: Node.js Foundation - node.js & io.js Convergence https://github.com/jasnell/dev-policy https://github.com/nodejs/node

引用来自“Raphael_goh”的评论

你确定能打开?

引用来自“vivid”的评论

骚年,这里是天朝
能打开
_-
_-
表示 呵呵
吾爱
吾爱
dart咋样
0Scn
0Scn
Joyent把IaaS/PaaS云平台那套做基础层的思维强加给Node,方向都是错的,他都没搞明白世界人民为何喜欢Node且喜欢拿Node来做啥。想攒bug,一年两载来个统一大修,憋大招,做基础层的银弹一统全世界?呵呵。高吞吐主要得益于事件驱动的异步,执行性能主要受益于V8,你不紧跟V8的迭代节奏适应时代的发展,难不成在憋一个甩V8几条街的引擎?就国内来说,不妨看看阿里、腾讯这些渐进式的局部性的换Node来做些什么,人家会大刀阔斧的把基础层换Node吗?呵呵。期待Node基金会早日掌夺大权,过渡期别太久了,赞io.js这活得明白又勤奋的孩子,傻逼又贪婪的Joyent。
vivid
vivid

引用来自“大猛0403”的评论

不是说要合并了么

引用来自“开源中国匿名会员”的评论

不是已经开始合并了吗: Node.js Foundation - node.js & io.js Convergence https://github.com/jasnell/dev-policy https://github.com/nodejs/node

引用来自“Raphael_goh”的评论

你确定能打开?
骚年,这里是天朝
周星星
周星星
图表有点坑
返回顶部
顶部