Java is said to be much faster than python but there are different ways to run these languages (e.g. pypy for python, maybe dalvik for java). Is there any way python could be made faster than java?
Python vs. Java performance (runtime speed) - Stack Overflow
Is java faster than python?
Why Python is slower than Java?
Which language, Java or Python, can process data faster?
Videos
Java is faster than Python. Easily.
Python is favorable for many things; speed isn't necessarily one of them.
References
- python.org/Language Comparisons
- C++ vs Java vs Python vs Ruby : a first impression
- A subjective analysis of two high-level, object-oriented languages: Comparing Python to Java
If you ignore the characteristics of both languages, how do you define "SPEED"? Which features should be in your benchmark and which do you want to omit?
For example:
- Does it count when Java executes an empty loop faster than Python?
- Or is Python faster when it notices that the loop body is empty, the loop header has no side effects and it optimizes the whole loop away?
- Or is that "a language characteristic"?
- Do you want to know how many bytecodes each language can execute per second?
- Which ones? Only the fast ones or all of them?
- How do you count the Java VM JIT compiler which turns bytecode into CPU-specific assembler code at runtime?
- Do you include code compilation times (which are extra in Java but always included in Python)?
Conclusion: Your question has no answer because it isn't defined what you want. Even if you made it more clear, the question will probably become academic since you will measure something that doesn't count in real life. For all of my projects, both Java and Python have always been fast enough. Of course, I would prefer one language over the other for a specific problem in a certain context.