Hacker News new | ask | show | jobs
by Raynos 5341 days ago
It's pretty well known that Java hovers around 1.1x the speed of C where as JS hovers around 2-3x the speed of C.

So yes Java is faster.

2 comments

{ 'offtopic' : "

I totally agree with you, but i just want to draw your attention to the phrase 'the speed of C'. You almost make it seem like it's a global constant, like the real C-for-celeritas speed of light, some unobtainable blazingly fast mirage accessible only to quantum physicists and unix greybeards.. but we don't need a particle accelerator to beat the performance of C, just better JITters. There's not really anything in the language stopping the performance from being reached (okay, well for JS there's the type system.)

" }

When I say the speed of C. I'm really comparing various language X compilers to the GCC compiler under the assumption that the GCC compiler is the best.

No it's not a magical constant but I think for a baseline comparison "how close your compiler X is to GCC" is a fair thing to compare.

I also doubt V8 or spidermonkey can get better then GCC _on average_

Thanks for the replies. I wasn't aware that JS was that much slower than Java, and I also wasn't aware that Java had closed the gap so significantly vs C.