3 ms·
Yeah. Recently switched some Blender Python algorithms I wrote to Swift/Metal, and the speedup was somewhere between 1000 and 1000000 depending on the algorithm
by auggierose 8y ago
Yeah. Recently switched some Blender Python algorithms I wrote to Swift/Metal, and the speedup was somewhere between 1000 and 1000000 depending on the algorithm.
- stevesimmons 8y agoSpeedups of that magnitude suggest the original Python approach was particularly inefficient...
- targafarian 8y agoYeah, properly written Python is at extreme worst O(1000) times slower than speeding it up code with a Numpy/Numba/c/Fortran/etc. implementation. Brute-force loopy code in Python I've seen is 100x slower than the compiled alternatives. So I agree, these extreme numbers are the sign of writing the worst possible Python implementation of a thing and saying Python sucks.
- auggierose 8y agoNot going to dispute that. If I spend time optimising code, I might do it as well in an environment like Swift/Metal instead of Python.
- kilon 8y agoWho would have guessed that compiled, static, non-dynamic, hardware accelerated code would be a ton more performant than runtime, highly dynamic, garbage collected and very powerful code that is not hardware accelerated.
- auggierose 8y agonot sure though what you mean by "very powerful code" in that context ;-)