4 ms·
> Javascript in V8 is more performant than Java on a lot of tasks, Source? I constantly see companies switching from the likes of python and javascript to comp
by azth 5y ago
> Javascript in V8 is more performant than Java on a lot of tasks,
Source? I constantly see companies switching from the likes of python and javascript to compiled languages after they reach a certain scale.
I find Java to be extremely developer friendly, especially nowadays with features like pattern matching, records, switch expressions, and the upcoming project Loom
Modern frameworks like quarkus.io are also a step in that direction. You might also want to check out https://jodd.org/ https://jodd.org/.
- kaba0 5y agoJavascript is much closer to java than to python in terms of performance. And due to the variability of the JIT compilers, it can sometimes be faster than java, but generally the latter wins out. But the parent poster is right that the two teams did choose a different workload to optimize for, V8 being fast faster while java taking more time to JIT compile a region, but that is mostly due to the difference between their most-common uses, running websites’ code as soon as they load vs mostly running on huge—ass servers with sometimes terabytes of RAM.
- jollybean 5y agoSource? Reality! :) I've built V8 instances and run some tests, but you don't need to do that. Just write some roughly equivalent code and run it in Chrome vs. JVM and see for yourself. It's not nuance or controversial, it will really 'stick out'. In basically all cases, V8 will 'get fast very quickly', it reaches a high level of performance on the second or 3rd iteration of a bit of code, whereas Java takes thousands of iterations. That's a very, very broad and crude generalisation, but you'll see it very clearly if you just try it yourself. It actually does make a difference depending on what you are doing as well - if you're running as server that uses the same code paths all day long, and executes them 1K times per minute, well then Java is fine. But for things like UI I particular where yo need the code to react it's a problem. 'Developer friendly' and 'modern frameworks' are a another question.