3 ms·
Cython actually shows the cost of interpretation quite well. Even without added type declarations it speeds up a quicksort of a list of integers by anywhere fro
by nly 13y ago
Cython actually shows the cost of interpretation quite well. Even without added type declarations it speeds up a quicksort of a list of integers by anywhere from 40-50%.
https://github.com/psoberoi/stepanov-conversations-course/tree/master/languages/python https://github.com/psoberoi/stepanov-conversations-course/tr...
I certainly don't see Cython as anything but a quick way to get efficient C code in to Python module though... you typically get the worst of both worlds with compilation + dynamic typing.
- pekk 13y agoWhy are you not using existing, efficient sort implementations?
- nly 13y agoThe github repo is from Alex Stepanovs course at A9, which is largely focused on data structures and algorithms. The point of the benchmarks is to compare 'FORTRAN like' code in many languages and to demonstrate that languages don't really matter if you pick the right DS&As. That quicksort algorithm is about as efficient as it gets btw.