Mark Lewis
1 min readDec 15, 2021

--

The thing about machine learning performance is that the libraries are generally written in low-level languages, like C++, and often will take advantage of additional hardware, like GPUs. The claim in your original article is that Python is more performant than Java. That’s simply false. Indeed, it is completely backward. Python seems to do well in machine learning because it is calling optimized C/C++ libraries, not because of the performance of Python itself.

Note that the link I gave actually shows the exact source code and methodology used in all the testing. You can do the tests yourself. Here’s the specific page for N-body (https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/nbody.html). Copy the code for Python and Java and do the tests yourself if you don’t believe their results. If you want to prove that Python is faster, rewrite the Python code in a way that makes it go faster. You can probably do better than the existing code using numpy (a C-library), but I seriously doubt that you can beat the Java performance even using that.

--

--

Mark Lewis
Mark Lewis

Written by Mark Lewis

Computer Science Professor, Planetary Rings Simulator, Scala Zealot

No responses yet