From: Gareth McCaughan > Mhm. And what happens if you want to sort something other > than integers? Say, Python objects with their own comparison > operators? Or even just (int,int) tuples? I got the impression that Armin's point was that Psyco can optimise the integer case *if* the code is in Python, but not if it's in C. I suspect that sort isn't a good example here, but heapq may be. By recoding it in C, the chance of getting of type-specific specialised speedups is lost, in favour of a (possibly) smaller speedup across the board. To get a feel for whether the right tradeoff has been made, you'd need to analyze real use cases in some detail (which may not be worth it). [Armin, how does Psyco + a Python sort compare against timsort on more general objects?] Hmm. I'm torn. On the one hand, it's really cool that Python+Psyco can out-perform C (another argument against the knee-jerk "recode bits in C" reaction). But my gut feel is that not enough people use Psyco to make this a good answer yet. On the third hand, if we recode chunks of the stdlib in C, do we kill too many chances for Psyco to work its magic? Time for Psyco to go into the stdlib, maybe? :-) Paul.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4