4 ответов
+ 5
Python’s slowness is partly due to the fact that it is a dynamically typed language. Unlike statically typed languages like java, most of the work of a dynamically typed language is done at run time. Dynamic datatypes and methods look up can be very expensive and time consuming. This can make the language relatively slow compared to compiled and statically typed languages like java, c, c++ for which most of the work is done at compile time.
+ 3
With interpreted languages, every instruction needs some additional work of being translated from the human readable form to the machine readable form. This takes extra time making the process slower than in the case of a compiled language.
+ 2
Seb TheS Java is compiled to bytecode that is platform-independent and therefore portable. This is one of the key "selling points" of the language.
But this bytecode is then interpreted by the platform-specific JVM, and this takes some performance overhead, compared to languages that compile directly into native code.
However this difference has really diminished a lot since early versions of java, because JVM technology improves all the time, with various performance optimizations, and JIT (just-in-time) and AOT (ahead-of-time) compilation.
+ 1
philip appiah Someone told Java would also be slow, is this true? Why would Java be slow?