Concerns about performance w/Python, Pysco on Pentiums

Michael Hudson mwh at python.net
Thu Mar 6 12:39:51 EST 2003


Peter Hansen <peter at engcorp.com> writes:

> Michael Hudson wrote:
> > 
> > You might also try a list of functions rather than a dict.  I think
> > psyco knows more about lists than dicts.  But ICBW.
> 
> Ah, thanks.  My lateral-thinking cap must have been off.  Although
> dicts are fast in Python in general, in this case the items in the
> list are tightly constrained (opcodes, from 0 to 255) and a list 
> is quite feasible.  I'll give it a shot - thanks! :)

In which case, I'd expect lists to be faster than dicts w/o psyco too,
'cause of the special casing for list[int] in ceval.c.

Cheers,
M.

-- 
  Finding a needle in a haystack is a lot easier if you burn down
  the haystack and scan the ashes with a metal detector.
      -- the Silicon Valley Tarot (another one nicked from David Rush)




More information about the Python-list mailing list