4 ms·
No. The JVM should be included too as it is part of what the language needs to run. If you wanna compare including the boot of the real machine, then go for it
by jdright 10y ago
No. The JVM should be included too as it is part of what the language needs to run. If you wanna compare including the boot of the real machine, then go for it as to run the JVM you still need a real machine to boot, but then you're adding noise as the machine is the same for the two programs and can, due external out of control reasons, have different timings. But still, JVM IS part of the language and the program unless you compile to native.
- ygra 10y agoTo add to this: The same goes for C's process startup (at least the OS won't call main with those arguments; the C stdlib performs some tasks before your code runs), or interpreter startup. Unless you're writing in assembler and call the OS directly, almost every programming language will have some overhead when starting. Granted, managed languages like Java are much worse than many others.
- benchaney 10y agoThis is true, but any overhead that C has Java will also have because the JVM is itself an ELF binary.