Nodejs "Hello world" benchmark

新版本 nodejs 性能

本文将记录 nodejs 历史更新中所有版本的hello world性能测试。

测试环境

MacBook Pro 
13-inch, Mid 2010

Processor  2.4 GHz Intel Core 2 Duo
Memory  8 GB 1067 MHz DDR3
Software  OS X 10.8.2 (12C60)

测试 helloworld.js

js
var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, "127.0.0.1");

console.log('Server running at http://127.0.0.1:1337/');

siege 压测命令

bash
$ siege -c 100 -b -t 10s http://127.0.0.1:1337/

测试结果: trans/sec (QPS)

  • v0.9.x
0.9.80.9.70.9.60.9.50.9.4 0.9.30.9.20.9.10.9.0
68456999709969806568 7381752077107681
  • v0.8.x
0.8.19 0.8.180.8.170.8.160.8.150.8.14 0.8.130.8.120.8.110.8.100.8.9 0.8.80.8.70.8.60.8.50.8.4 0.8.30.8.20.8.10.8.0
0.8.19 76797613764976597593 77007803783378017656 78867840775979267933 7802772877247702
  • v0.7.x
0.7.0
7676
* v0.6.x
0.6.80.6.70.6.60.6.50.6.4 0.6.30.6.20.6.10.6.0
76737791804680608111 8070813882408157
* v0.5.x
0.5.100.5.90.5.80.5.70.5.6 0.5.50.5.40.5.30.5.20.5.1 0.5.0
82007259707170986996 8073-79318127--
* v0.4.x
0.4.120.4.110.4.100.4.90.4.8 0.4.70.4.60.4.50.4.40.4.3 0.4.20.4.10.4.0
75107558760076066588 79167931796079817930 796579757490
* v0.3.x
0.3.80.3.70.3.60.3.50.3.4 0.3.30.3.20.3.10.3.0
78107871781588809000 899992009347-
* v0.2.x
0.2.60.2.50.2.40.2.3 0.2.20.2.10.2.0
7525748174897500 741071367130
* v0.1.x
0.1.1040.1.1030.1.1020.1.1010.1.100 0.1.990.1.980.1.970.1.960.1.95 0.1.940.1.930.1.920.1.910.1.90 0.1.0
76407538753776747040 72807211734072707210 70637931802085618146 -

v0.6.0与v0.4.12的性能对比

v0.6.0更新 说明文章中,列出的对比数据

v0.4.12 (linux) v0.6.0 (linux)

http_simple.js /bytes/1024  5461 r/s    6263 r/s
io.js read                  19.75 mB/s  26.63 mB/s
io.js write                 21.60 mB/s  17.40 mB/s
startup.js                  74.7 ms     49.6 ms

v0.4.12 (windows: Cygwin) v0.6.0 (windows)

http_simple.js /bytes/1024  3858 r/s    5823 r/s
io.js read                  12.41 mB/s  26.51 mB/s
io.js write                 12.61 mB/s  33.58 mB/s
startup.js                  152.81 ms   52.04 ms

v0.4 和 v0.6之间的更新说明请查看: API-changes-between-v0.4-and-v0.6

有爱

^_^ 希望本文对你有用

Comments

Deploy on Void