This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sbrunthaler
Recipients sbrunthaler
Date 2012-05-08.17:37:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1336498675.39.0.776636251166.issue14757@psf.upfronthosting.co.za>
In-reply-to
Content
The attached patch adds quickening based inline caching (INCA) to the CPython 3.3 interpreter. It uses a code generator to generate instruction derivatives using the mako template engine, and a set of utility functions to enable automatic and safe quickening.

The code generator itself resides in "cgen" and the generated files reside in "Python/opt/gen". Auxiliary files resides in "Python/opt" and only minor changes are necessary in ceval.c and places where type feedback is possible (mostly in abstract.c and object.c)

Details of the technique have been published (see my home page: http://www.ics.uci.edu/~sbruntha/.) 

On my machine (i7-920 with Intel Turbo Boost disabled) this results in average arithmetic speedups of 1.47 over the vanilla interpreter without threaded code/computed gotos, and 1.13 over an interpreter with threaded code/computed gotos enabled. (Maximal speedups are 1.61 over the vanilla interpreter and 1.17 over the threaded code interpreter.) The optimized interpreter uses 206 instructions which currently only cover the standard library, i.e., there is still ample space left for optimized instruction derivatives for popular applications/libraries, such as NumPy or Django.

Furthermore, based on the purely interpretative nature of the technique, there are no compatibility implications (modulo libraries/modules relying on concrete opcode values---I would guess that such code is rather unlikely, but one never knows...) Additional memory overhead is minimal, too, since the technique only requires space for the new derivatives and is something along the lines of 80-100 KiB.
History
Date User Action Args
2012-05-08 17:37:56sbrunthalersetrecipients: + sbrunthaler
2012-05-08 17:37:55sbrunthalersetmessageid: <1336498675.39.0.776636251166.issue14757@psf.upfronthosting.co.za>
2012-05-08 17:37:54sbrunthalerlinkissue14757 messages
2012-05-08 17:37:54sbrunthalercreate