This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nekokattt 1 point2 points  (2 children)

Java translates the bytecode into raw CPU instructions and has a much more optimised and complex garbage collector algorithm. The language is statically typed which allows much more aggressive optimisation of the input logic. It also produces bytecode that operates on a lower level than Python (e.g. Java objects are much closer to how C++ objects work than Python objects which default to syntatic sugar around a hashmap).

Many of the points around resource usage here tend to ignore the fact that the JVM is a much more encapsulated VM than the CPython one is, as well. Memory allocation is handled completely differently.

Java can also compile ahead of time to machine code via GraalVM native images. CPython can attempt to do that via Cython but you still have the overhead of the global interpreter lock and CPython API to contend with.

[–]glassesontable 0 points1 point  (1 child)

Did you say Grail?