Hacker News new | ask | show | jobs
by arcticbull 4266 days ago
This amounts to a nice benchmark of various implementations of rand() ^_^

Generally, a language in and of itself doesn't have performance characteristics. What you are measuring is the quality of the output of it's compiler. While he indicates PHP is way at the back of the pack, I'd guess that a few years ago JavaScript would be right there with it, but by designing sufficiently advanced compilers you can make any programming language fast.

I remember reading a few years ago that on MacOS X (PowerPC), code generated by IBM XLC was some 50% faster than that generated by GCC for some benchmark (this was before LLVM) -- and that was on the same exact language.

1 comments

I would agree that this is a test of rand(). There is no significant difference in the workload... other than the library implementations of the rng. All the lower-level compilers (C,Go,Rust) should be producing effectively the same code for this which then calls out to the ir library rng. I strongly suspect the time is dominated by the rng duration. Maybe someone should benchmark the rng??