Check out example codes for "why python is slower than java". It will help you in understanding the concepts better.

Code Example 1

Python is dynamically typed, while Java is statically typed.
That's very important when we're talking about speed, because 
it is actually noticeable in compilation time. 
Generally speaking, we could say that Python launches faster 
and runs slower, while Java launches slower and runs faster.

Learn ReactJs, React Native from akashmittal.com