Mark Hammond wrote: > > /F: > > just for the record, I just changed some generic sequence code > > to something like: > ... > > so in other words, this construct is more than 4 times faster > > than plain use of PySequence_GetItem. > > Good stuff! > > > guess it's time to fix a couple of things in PIL... > > Its a fair bit of code to duplicate everywhere you want the speed increase. > How can we add a similar scheme to the core, so the changes people need to > make are trivial (to the point where the change is zero!)? We could add special code the standard type to PySequence_GetItem() et al., but it would still cause a C function call (not much, but noticable in inner loops). How about adding some inline markers to the most often used (and small) routines in the medium level abstract interface (PySequence_*, PyMapping_*, etc.) ?! Together with the special code for the native Python types this should yield a speedup for all extensions by simple virtue of a recompile... OTOH, changes to these APIs would need a recompile of the extensions too. BTW, I've used the same approach as Fredrik in mx.Tools. It does make great a difference... -- Marc-Andre Lemburg ______________________________________________________________________ Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
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