Benchmarks: Node.js vs. Go vs. PHP
jaxbot.me
jaxbot.me
Secondly, the sort function only runs once, and then just does nothing 99,999 times. My guess is the V8 JIT and the GO compiler realize this and optimize it out. Since PHP is interpreted it's shit out of luck.
Original Array ( [0]...) 28.913233995438
Original - with real sorting Array ( [0]...) 29.863515853882
HN Way - with external count() Array ( [0]... ) 4.3388159275055
HN Way - with external count() and real sorting Array ( [0]...) 5.5680060386658
I've been looking into Node.js lately and have wanted to see direct comparisons between the two - I currently use PHP mainly.