4 ms·
>The JVM is still slow What are you talking about? It's the fastest widely deployed VM out there...
by coldtea 11y ago
>The JVM is still slow
What are you talking about? It's the fastest widely deployed VM out there...
- twp 11y agoIf you want to talk about "widely deployed VMs" then Dalvik is faster. If you want to talk about VMs in general then there are many that are faster, e.g. LuaJIT.
- coldtea 11y agoActually no, Dalvik is slower than the JVM and with worse GC. And LuaJIT faster than the JVM? Where you got that? You wont fine many benchmarks or people agreeing with you. LuaJIT is faster (much) than most scripting languages, but not faster than Java. Are you comparing startup time?
- danieldk 11y agoDalvik is ~3x slower than JVM for compiled (JITed) code (on an ARM Cortex A8): https://dl.acm.org/citation.cfm?id=2388956 https://dl.acm.org/citation.cfm?id=2388956
- sanderjd 11y agoIt's always fun to see how different people throw around the seemingly-absolute terms "slow" and "fast" when there is always some other platform they're implicitly comparing to. I had a chuckle about this the other day as I was evaluating BEAM for potentially running a re-write of a Rails app; I was thinking how pleasant it was to use a platform so fast when I came across people ridiculing how slow Erlang is (presumably relative to C++ or even the JVM).
- tormeh 11y agoThose people don't get the point of Erlang. You'd have to be completely oblivious to complain about performance on the Erlang VM. The Erlang developers will always sacrifice performance and everything else in favor of reliability and response time. Consider that every actor has its own heap and GC. That's slightly absurd, honestly, but it makes sense when you think about Erlang's goals. I just get so frustrated when people say things like that.
- codesushi42 11y agoIndeed, these claims always lack context of what is being attempted. If you are using Erlang to perform matrix multiplications on large datasets or some kind of CPU intensive work, you're probably barking up the wrong tree. But if you want to parallelize and distribute less CPU intensive tasks and have fault tolerance, then it's a good choice.
- fleitz 11y agoBeing the fastest VM doesn't make a VM fast. It's just faster than other slow things.
- tormeh 11y agoTrue, but thankfully the JVM is faster than most compiled languages as well.
- fleitz 11y agoYes, that's why modern triple A titles are written on the JVM. The JVM can generate faster numeric code than C++ in limited instances and when writing in C/C++ style. And then when you want to be faster than java you drop down to ASM and use a few SIMD instructions. In the general case when you write real applications it's much slower. Not to mention that no one wants to drop 12 frames waiting for GC.
- danieldk 11y agoWhy does someone bring up game performance when the discussion is about JVM versus native code? Languages with a GC compiled to native code have the same problems, even C/ASM calls can be relatively expensive in languages compiled to native code (e.g. see Go). There are many other classes of applications outside games where a few milliseconds of garbage collection are acceptable. It is no surprise that many server applications are written in JVM languages - the 2x C/C++ performance is acceptable when people get a lot of instrumentation, more safety, etc.
- fleitz 11y agoJava is rarely 2x faster than C/C++. I would say the primary reasons server apps are written in Java is the enterprise support and giant ecosystem as well as number of developers who can write java. The performance on the server is decent, and great compared to ruby/python. People bring up video games because they are the most demanding apps most people run. Similarly you'll see apps like Photoshop, Office, etc written in C++. Languages with a GC blah blah blah don't matter because no one writing C++ for performance uses a GC with it. I'm comparing C++ to Java for real world apps not language benchmarks, etc. C++ would not be my first choice for a web app because the task is trivially parallelizable and you get little improvement in string copying between C++ / Java / etc which is the primary thing web apps do, copy strings.