3 ms·
Sure, there's some transition region between "don't care" and "care" but I find a lot of people tend to be strongly in one or the other (sometimes wrongly). An
by YZF 12y ago
Sure, there's some transition region between "don't care" and "care" but I find a lot of people tend to be strongly in one or the other (sometimes wrongly).
Another benchmark: https://days2011.scala-lang.org/sites/days2011/files/ws3-1-Hundt.pdf https://days2011.scala-lang.org/sites/days2011/files/ws3-1-H...
Keep in mind though that the JVM is a moving target. It keeps getting better (on one hand) and on some platforms it's worse (e.g. Android, though the upcoming new version looks promising). It's possible the gap is smaller now than what I remember seeing in the past.
At any rate, if x2 is a number that feels right for the stuff you're doing I can't argue with that. You need to choose the language that works for you. Maybe you choose Java because of the libraries. Maybe you have more experience writing in Java and you're a lot more productive. Maybe there is better tooling. Maybe it's just more in line with how you think.
A web server does a lot of file I/O and a lot of network I/O. The performance of a web server is more about how efficiently you can juggle those given highly concurrent loads and what mechanisms are used at the native layer to interface to those systems. It's not so much about the "raw" power of the language. In your game engine example a lot of the heavy lifting is done in OpenGL which is native code. I'm also not intimately familiar with the details there. At some point it's also about how much effort went into optimizing things and whether or not something else was traded off.
To contrast that, Google Code Jam tasks are typically algorithmic and they stress the "raw" power aspect of the language. That said it's certainly not representative of real-world product development.
- nsajko 12y agoIf you are thinking about the Android runtime, Dalvik and now ART, those aren't JVM (I think they compile to a different bytecode). There probably is a port of JVM but I didn't get the impression you were talking about that.
- YZF 12y agoDalvik does indeed use a different VM/bytecode. Your Java Android app is compiled JVM bytecode which is translated into Dalvik. The point is/was that the program you write in Java may run faster or slower depending on your target platform and that if your target platform is Android you are taking an additional penalty vs. e.g. using the NDK... (EDIT: Yeah, you're right, the name JVM should only be used to refer to the specific type of VM that runs specific bytecode and not to other VMs. As Android shows Java does not have to run on the JVM. Thanks for the correction.) "In 2012, academic benchmarks confirmed the factor of 3 between HotSpot and Dalvik on the same Android board, also noting that Dalvik code was not smaller than Hotspot" (from Wikipedia)