Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
very long pause….
@luxe011 Java is not a low level language. Of course hight is relative. By it's original meaning even C and HL assembly are high level languages.
Even by more modern standards C#, Java and python is all managed code. That is they are not executed on its own they require a form of interpreter. It's the .net or mono Framework for C#, Java VM for Java and Python comes with an interpreter. There is also Cpython and Cython what brings it in the realm of compiled languages.
Besides the point you are not wrong Java is very fast. Especially when used by knowledgeable people but all those languages I mentioned have a long initialisation time as they need to bootstrap a runtime environment.
JustThat2636107dI CRC what you did there
@hjk101 depends on what you meant by 'translates'.
I figured you meant that jvm interprets bytecode as it runs and makes a live translation into machine code on-the-go.
I meant the jit actually compiles bytecode into the platform-speciffic machine code and caches those pieces of native code in-memory. This way bytecode runs as fast, and in some cases even faster than native code compiled from c++.
@netikras what I "meant" is that a jvm is a vm. Something that stimulates a processor that speaks bytecode. So the VM translates/converts that into the platform specific machine code. No matter if it's just in time or ahead of time. It's something that happens at runtime. Just like many other languages do. It is not however just as fast. There are some rare cases where a JIT compiler can make better branch predictions and therefore optimise the instructions better than a normal compiler. But normally I see results like https://benchmarksgame-team.pages.debian.net/...
Don't forget the init hit; in short running programs it can be a big issue. Also the overhead of GC (like ref counting) can have a negative impact compared to languages that don't have a GC. Most performance impacting vectors have nothing to do with that way the code gets converted into machine code.