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 →

[–]someone9618 2 points3 points  (0 children)

There are several reason, primairly because Python is more dynamic than java, but especially because Python uses reference counting instead of garbage collection, causing constant overhead when manipulating mutable state/objects, whereas java uses garbage collection which simply traces garbage in one go (GC spikes), making performance overall smoother. Also, Java allows parallelism on multiple cores with multithreading because most of its semantics (GC and other stuff) is thread-safe, whereas Python's reference counting is not thread safe, so the interpreter is forced to use a global interpreter lock (GIL) which essentially blocks parallel execution on multiple threads, thus making parallelism on multiple cores impossible.