Hacker News new | past | comments | ask | show | jobs | submit login

Isn't javascript really really really fast?

The Julia websites has a benchmark for various languages performing some tasks. Javascript seemed pretty comparable to Java.




Every language has it's pros and cons in terms of performance and benchmarks are notoriously inadequate to compare but my general probing of people in the industry result in the following regarding language speed:

1. c/c++ is the fastest.

2. modern java is either the same as c/c++ or about 2x slower

3. modern javascript (i.e. v8) is about 4x slower then java.

4. python/ruby and most other dynamic languages are about 10x slower then java.

Never seen C# really compared with others because it's rarely ran on the same systems.

Go, Rust and all the new shiny languages are still far away from when we can infer about their performance, but they are probably somewhere around the Java level.


Source? According to this Rust is faster than Java http://benchmarksgame.alioth.debian.org/u32/performance.php?... Here you can see that it wins in almost every benchmark compared to Java http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...


>> is faster than Java

You seem to have cherry-picked that single-core-x86 n-body measurement just because the quad-core-x64 n-body program measurements are slower than the Java program measurements.

http://benchmarksgame.alioth.debian.org/u64q/performance.php...


Like I said, benchmarks are a terrible way to gauge performance, most of my rankings come from people's experience in various situations, Rust is too young for people to have any experience with it.


Also, the Python JIT compiler PyPy in many cases matches or exceeds V8.


I wouldn't lump all of the "new shiny languages" together; they all have their own performance profiles.


Sorry, I meant all the new shiny languages are too young to make good estimation about and from those Go and Rust appear to be somewhere in the Java level.

Didn't mean to imply that other shiny languages are in the Java level, just bad grammar on my part I suppose.


Why do you think Rust is at the Java level for example?


It's a low level language without a GC and compiles to LLVM, it should in theory rival C/C++ in performance, but it's still young and only recently begun making headways for performance.

So just a hunch, also some barely usable benchmarks that appeared on HW a few months back.


> only recently begun making headways for performance

What gave you this impression? MIR landing?

I'm not saying it is a wrong impression, but it doesn't match mine. My impression is that Rust is routinely very fast, often rivals C, and most of the recent headways were surrounding the performance of the compiler, not the resulting programs.


Worth noting that Dalvik/ART has very different performance characteristics than a desktop or server JVM (many of the optimizations that proguard does matter a ton on Android where they wouldn't matter very much at all with the jvm).


Javascript has been optimized to hell but I'm not sure I would call it really really fast. Its still going to be much slower than Lua (a language that its easier to make go fast) and a good Javascript JIT interpreter uses lots of memory and needs some warmup time.




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

Search: