neil toronto upnmgmpqcsbyuedu greg ewing wrote neal norwitz wrote part done differently strings used code objects interned stored dictionary since two interned strings compared pointer identity dont see differs significantly unique integer idea integers used directly index array instead used dict keys might make difference cost would every namespace would need big number names existence extremely sparse already data structure sparse arrays called dict every attribute name guaranteed interned string currently case attribute names kind object might possible add another dict specialization interned string lookup wins would lookup could assume strings hash valid equality comparison could done via pointer comparison however think attribute cache patches went 26 30 mostly take care lookup speed issues assume strings interned already cache hit consists calculating cache index string hash ensuring attribute name index identical via pointer comparison attribute name looked returning associated value lookup attribute thats string interned automatically cache miss happens rarely specializing dicts interned strings would optimize cache miss making 30 patch found happened rarely benchmarks regression tests somewhere around 5 cache miss isnt expensive dict lookup attribute searched every type supertype object occasional string equality test probably doesnt register id happy shown wrong though neil _______________________________________________ pythondev mailing list zvlllneumpythonorg httpmailpythonorgmailmanlistinfopythondev unsubscribe httpmailpythonorgmailmanoptionspythondevpythondev40tangomucom wed 06 aug 2008 090638 0600 pythondev python 3000 special type object attributes map keys