[Python-bugs-list] [ python-Bugs-420490 ] lookdict_string does not use interning

noreply@sourceforge.net noreply@sourceforge.net
Tue, 01 May 2001 10:06:32 -0700


Bugs item #420490, was updated on 2001-05-01 10:06
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=420490&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Greg Chapman (glchapman)
Assigned to: Nobody/Anonymous (nobody)
Summary: lookdict_string does not use interning

Initial Comment:
In Python 2.1, when a dictionary uses lookdict_string 
to retrieve items, the function used to compare 
strings is PyString_Type.tp_compare, i.e. 
string_compare.  string_compare does not check if its 
parameters are actually the same PStringObject *, so 
an actual string comparison is made even if the 
dictionary's keys have been interned.  Python 1.52 
used PyObject_Compare to compare all keys, and this 
function did check to see if its parameters were the 
same PyObject *.

I wonder if this might be one source of the slow-down 
in Python 2.1?


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=420490&group_id=5470