Surprising (for me) benchmark results...

Courageous jkraska1 at san.rr.com
Tue May 1 19:20:23 EDT 2001


>In Perl and Java, the builtin sort, and in C++ std::sort.  Why would
>you expect this to be best in Python?

Python uses "Sample Sort," a highly optimized form of quick sort
that's very difficult to beat. Note well that some algorithms may
share a primary complexity factor, but you can still shave off
secondary complexity factors in order to double or even triple
algorithm speed while maintaining the same primary complexity.

For example O( logN) might be O ( logN + big-K ) or O ( logN / 3).

Sample sort is in all likelihood what's being demonstrated here.
Furthermore, virtually all the work of this program is actually occuring
in native C. Which happens fairly frequently in Python, so the example
stands, IMO.


C//




More information about the Python-list mailing list