2 ms·
That is where a JIT enters the picture, ideally a JIT can re-optimize to an ideal state. While this is suboptimal when doing one shot execution, when an applic
by pjmlp 2y ago
That is where a JIT enters the picture, ideally a JIT can re-optimize to an ideal state.
While this is suboptimal when doing one shot execution, when an application is long lived, mostly desktop or server workloads, this work pays off versus the overall application.
For example, Dalvik had a pretty lame JIT, thus it was faster calling into C for math functions, eventually with ART this was no longer needed, JIT could outperform the cost of calling into C.
https://developer.android.com/reference/android/util/FloatMath https://developer.android.com/reference/android/util/FloatMa...
- genewitch 2y agoDepending on the math (this is a hedge) you need, FORTRAN is probably faster still. Every time I fathom a test and compare python, fortran, and C, Fortran always wins by a margin. Fortran:C:Python 1:1.2:1.9 or so. I don't count startup I only time time to return from function call. Most recently I did hand-looped matrix math and this ratio bore out. I used gfortran, gcc, and python3.
- pjmlp 2y agoSure, but that doesn't fit the desktop or server workloads I mentioned, I guess we need to except stuff like HPC out of those server workloads. I would also add that modern Fortran looks quite sweet, the punched card FORTRAN is long gone, and folks should spend more time learning it instead of reaching out to Python.