PHP 5.6.4
$ time php bench.php
Array
(
[0] => 1
[1] => 1
[2] => 2
[3] => 3
[4] => 3
[5] => 4
[6] => 5
[7] => 12
[8] => 52
[9] => 92
[10] => 424
[11] => 4124
)
2.3711581230164
real 0m2.383s
user 0m2.373s
sys 0m0.010s
HHVM 3.5.0
Array
(
[0] => 1
[1] => 1
[2] => 2
[3] => 3
[4] => 3
[5] => 4
[6] => 5
[7] => 12
[8] => 52
[9] => 92
[10] => 424
[11] => 4124
)
0.13958597183228
real 0m0.414s
user 0m0.247s
sys 0m0.033s
Go 1.4.1
And yes, I include the compile time also for fairness.
$ rm bench; time(go build bench.go && ./bench)
removed ‘bench’
[1 1 2 3 3 4 5 12 52 92 424 4124]
23.027575ms
real 0m0.191s
user 0m0.150s
sys 0m0.033s
$ time ./bench
[1 1 2 3 3 4 5 12 52 92 424 4124]
22.757741ms
real 0m0.024s
user 0m0.023s
sys 0m0.000s
NodeJS 0.10.35
$ time node bench.js
[ 1, 1, 2, 3, 3, 4, 5, 12, 52, 92, 424, 4124 ]
42
real 0m0.065s
user 0m0.060s
sys 0m0.003s
From what we could see (run duration - actual duration):
Go: 22ms - 24ms
NodeJS: 42ms - 65ms
Go (with compile duration included): 23ms - 191ms
HHVM: 139ms - 414ms
PHP: 2371ms - 2383ms
From what we could see (run duration - actual duration):
Go: 22ms - 24ms
NodeJS: 42ms - 65ms
Go (with compile duration included): 23ms - 191ms
HHVM: 139ms - 414ms
PHP: 2371ms - 2383ms
Go is awesome
ReplyDeleteyup, awesome indeed ^_^
DeleteWhat is the result if you exclude HHVM compile time?
ReplyDeletehow to measure hhvm compile time? it's JIT, it cannot be separated right?
DeleteCould you guys do another test? Go 1.5 vs HHVM 3.8.0? Maybe in a months time?
ReplyDeleteyes, probably when 1.5 officially released, but not for this benchmark, there are some other interesting benchmark than just bubblesort
DeleteAwesome, one thing tho. Could you introduce Elixir? I'd love a comparison. You could probably skip PHP lol
Delete1.5 is out now, looking forward to lots of micro benchmarks between golang 1.5 and hhvm 3.9!
ReplyDelete