Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is Java faster then JavaScript? Yes.

Is it easier to write performant code with node.js vs Java Async IO? Subjective.



Java is faster than Javascript on V8? This is accepted fact? Can you provide a reference?


Java AIO

  $ ab -n 30000 -c 300 http://127.0.0.1:8080/
  Concurrency Level:      300
  Time taken for tests:   4.908 seconds
  Complete requests:      30000
  Requests per second:    6112.65 [#/sec] (mean)
Node (January 2011)

  $ ab -n 30000 -c 300 http://127.0.0.1:8124/
  Concurrency Level:      300
  Time taken for tests:   8.140 seconds
  Complete requests:      30000
  Requests per second:    3685.69 [#/sec] (mean)
http://www.olympum.com/java/java-aio-vs-nodejs/


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.


{ '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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: