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

> Around the speed of Java and Go in some cases, which are compiled.

That is quite the claim, I wonder if you have any data to back that up. As it goes against everything I've seen.




Is it "quite the claim"?

The Javascript JIT arms race was the most heavily funded dynamic language arms race since forever - involving three major players (Apple, Google, Mozilla), dedicated teams, tons of benchmarks, constant tracking of performance improvements, total rewrites of the engines and additional JIT stages added, and public boasts in the official company blogs and marketing material!


It is still quite the claim.

Given the disadvantage that it starts at, JavaScript is astonishingly fast, due to the extreme investment in it that you mention. However, in almost all real-world scenarios, it’s still generally pretty easily beaten by ahead-of-time-compiled languages, even if on some microbenchmarks and for a few specific sorts of tasks it can end up competitive with certain of these compiled languages.


>However, in almost all real-world scenarios, it’s still generally pretty easily beaten by ahead-of-time-compiled languages

The claim to be refuted was not "Javascript is faster than AOT compiled languges" however.

Instead, the claim was: "[Javascript is] around the speed of Java and Go in some cases, which are compiled", which is not far off. Especially given that these two are not in general among the fastest kids like C, C++, and Rust.


Yeah, what I expressed was a bit sloppy. Go is AOT-compiled, but kinda the weak link among most such languages as regards performance. Java is somewhere in between the two, and the HotSpot JVM is also generally handily faster than JavaScript engines (it also has had rather a lot of effort put into optimising it, and without most of the starting disadvantages of JavaScript).


You really should take benchmarks with a grain of salt, but:

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

There are others as well like:

https://programming-language-benchmarks.vercel.app/go-vs-jav...

That being said, the specific performance characteristics isn't really the point. Even if you accept JavaScript and Go being similarly fast (same order of magnitude), JavaScript uses way more memory (which I'd argue doesn't really matter, but it's worth mentioning) and the DOM is the main bottleneck in the browser, so WASM won't save you completely there.


"In some cases" seems reasonable to me. Google poured a lot of money into V8 performance for 15 years. There's also situations like AWS's Lambda environment where more time was spent getting node/JS optimized for the environment.




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

Search: