Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
luxe0115654y@amarranjan0 I thing the language Python would be better used in this joke as Java is a low level language that runs relatively fast compared to a high-level language like Python
-
@amarranjan0 java [jvm] runs machine code. FYI ;) and machine code ain't slow last I checked.
Sooo.. I guess we can freely say:
- knock knock
- who's there?
- 90
- 90 who?
- 90s called and they want their joke back -
hjk10156964y@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. -
hjk10156964y@netikras bytecode is not machine code it is an abstraction that is halfway there though but the JVM translates it to machine code. You are not wrong JVM is really performant and efficient when when used.
-
@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++. -
hjk10156964y@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.
Related Rants
Two bytes meet. The first byte asks, “Are you ill?”
The second byte replies, “No, just feeling a bit off.”
joke/meme
java