[pypy-dev] Python 2.4a3

Armin Rigo arigo at tunes.org
Wed Sep 29 22:13:35 CEST 2004


Hi,

On Mon, Sep 27, 2004 at 08:25:41PM +0100, Armin Rigo wrote:
> Just out of interest (I haven't investigated yet), py.py loads in Python 2.4a3
> but 'import dis' apparently sends it into an infinite loop.  It also prints
> 'faking <type 'module'>' just after 'import dis', which it doesn't do with
> Python 2.3.3.

This is due to opcode.py, which in 2.4 uses string formatting to build opcode
names, while in 2.3 it uses concatenation.  From the diff:

< for op in range(256): opname[op] = '<' + `op` + '>'
---
> for op in range(256): opname[op] = '<%r>' % (op,)

As it happens, string formatting is *really* *slow* in PyPy now.  Every one
takes about 1 second!  So importing opcode.py takes several minutes.

Quoting Michael, "time to make string formatting faster".


Armin



More information about the Pypy-dev mailing list