New submission from stefan brunthaler <s.bruntha...@uci.edu>:

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.

----------
components: Interpreter Core
files: 20120508-inca.patch
hgrepos: 124
keywords: patch
messages: 160216
nosy: sbrunthaler
priority: normal
severity: normal
status: open
title: INCA: Inline Caching meets Quickening in Python 3.3
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file25499/20120508-inca.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14757>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to