[pypy-dev] [pypy-svn] r30034 - pypy/dist/pypy/objspace/std

Alexander Schremmer 2006a at usenet.alexanderweb.de
Sun Jul 16 23:40:01 CEST 2006

Hi Ben Young,

On Fri, 14 Jul 2006 12:12:59 +0100, Ben.Young at risk.sungard.com wrote:

> This looks really good! It shows there are still some major (easy) 
> performance wins in PyPy.

Yes, I measured 35% speedup on richards/pystone on "the other branch" (that 
solely knows this kind of dictionary unlike the current trunk).

> One question, why would you need any calls to str2object in any of the 
> non-mutating methods?

Because every class can define it's own hash/eq functions that might be 
considered insane in case of having them return hashes that match the 
hashes of a string. That would mean that {"foo": 1}[myClass()] could return 
1. Therefore we have to switch the mode while having a shortcut for types 
which are known to have sane hashes only.

>                 w_lookup.__hash__()

I didn't even consider that people would write __hash__ methods with 
side-effects :)

Kind regards,
Alexander, who has resent this posting 2 days after the initial try - Gmane

More information about the Pypy-dev mailing list