4 ms·
Isn't javascript really really really fast? The Julia websites has a benchmark for various languages performing some tasks. Javascript seemed pretty comparable
by blahi 10y ago
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.
- Illniyar 10y agoEvery 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.
- jjnoakes 10y agoI wouldn't lump all of the "new shiny languages" together; they all have their own performance profiles.
- Illniyar 10y agoSorry, 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.
- jjnoakes 10y agoWhy do you think Rust is at the Java level for example?
- Illniyar 10y agoIt'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.
- jjnoakes 10y ago> 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.
- lima 10y agoAlso, the Python JIT compiler PyPy in many cases matches or exceeds V8.
- sanbor 10y agoSource? According to this Rust is faster than Java http://benchmarksgame.alioth.debian.org/u32/performance.php?test=nbody 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?lang=rust&lang2=java http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...
- igouy 10y ago>> 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?test=nbody http://benchmarksgame.alioth.debian.org/u64q/performance.php...
- Illniyar 10y agoLike 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.
- esrauch 10y agoWorth 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).
- ufo 10y agoJavascript 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.