4 ms·
Why does Python get so much flak for inefficiencies? It's really not that slow, and in ML the speed-sensitive parts are libraries in lower level languages anywa
by Miraste 4y ago
Why does Python get so much flak for inefficiencies? It's really not that slow, and in ML the speed-sensitive parts are libraries in lower level languages anyway. Half of the optimization from this very post is in Python.
- chatmasta 4y agoIt might not be slow in general, but it's easy to write slow code in it.
- Closi 4y agoIn ML python is effectively the interface rather than the bit that is doing the heavy lifting. The interface is designed to be easy to use (python) and the bit that is actually doing the work is designed to be heavily performant (which is C & CUDA and may even be running on a TPU).
- chaorace 4y agoPython has the misfortune of competing against JS in this arena, which just so happens to have the most obsessively optimized JIT ever.
- Max-Limelihood 4y agoIn ML? No, the best competition for Python in ML is... well, it's either C++ or Julia, depending on how you define "competition," given Python is effectively a glorified C++ interface.
- Max-Limelihood 4y agoIt really is that slow. You're completely correct that the speed-sensitive parts are written in lower-level libraries, but another way to phrase that is "Python can go really fast, as long as you don't use Python." But this also means ML is effectively hamstrung into only using methods that already exist and have been coded in C++, since anything in Python would be too slow to compete. There's lots of languages that make good tradeoffs between performance and usability. Python is not one of those languages. It is, at best, only slightly harder to use than Julia, yet orders-of-magnitude slower.