3 ms·
The reason is that PyPy didn't exist, and C extensions were the way to go back then. That is no longer true. Anything else is misinformation. I don't use numpy
by JulianWasTaken 11y ago
The reason is that PyPy didn't exist, and C extensions were the way to go back then. That is no longer true. Anything else is misinformation.
I don't use numpy (or really very many scientific libraries), and talking about generalities like you mentioned just isn't meaningful, but here's a really old benchmark which is (small) evidence that it's just not true that these things need to be written in C anymore: http://morepypy.blogspot.com/2012/01/numpypy-progress-report-running.html http://morepypy.blogspot.com/2012/01/numpypy-progress-report...
- syllogism 11y agoWhy are you trying to push this point, when you plainly admit you don't know much about this? And so strongly, too! "Anything else is misinformation." I've seldom seen someone so confidently wrong. PyPy can address Python's slow loop performance and slow numeric calculations, in particular examples. This can help a lot. But if the problem requires you to carefully manage your data structures so that you get good cache performance, PyPy cannot help much at all. Consider this: there are very few non-toy examples of PyPy giving order of magnitude efficiency improvements over CPython, while other languages do typically run that much faster than Python implementations. Finally, if you don't want to talk about generalities...Consider my NLP library, spaCy: http://honnibal.github.io/spaCy/#speed-comparison http://honnibal.github.io/spaCy/#speed-comparison . It's the fastest library with this functionality in the world, among any language. This library is an example where you need C data structures just to make the working set manageable. You would need an enormous amount of memory just to load the models. In pure Python, the library would not be of much use to anyone --- so I would have written it in Java or C++.
- JulianWasTaken 11y agoI did not admit I don't know much about this, although I will now, but that's not the important thing in these discussions. Very few people in the scientific community know what's out there, and many are misinformed in the exact same ways. You seem to be suggesting that everything is fine, and that all the C code that exists right now in the scientific Python community is justified. This is incorrect. Needing "C data structures" (I'm guessing you mean memory management but I'd love to have a look at your library tomorrow morning) is certainly reasonable -- and there are better ways to do so than the CPython API. My point before, which I am pushing, yes, is that the scientific Python community is using old tools, and they'd benefit from using new ones that actually would directly benefit them, which PyPy will -- CFFI is a better choice than ctypes or the CPython API for way more agreeable reasons than whether Python 3 is a better choice than Python 2, and pure-python is a better solution than both for where it's applicable -- it's unimportant where that is to me, my point is "it's more than what we currently have in pure-python".
- Lofkin 11y agoNumba is faster than pypy and compatible with cpython.