[Python-Dev] Alternative implementation of string interning

Tim Peters tim.one@comcast.net
Mon, 01 Jul 2002 21:23:15 -0400


[Gordon, on extension modules implicitly relying on indirect interning]
> I bet most extension authors have been completely
> ignorant of it, which makes the answer "most of
> them" <wink>.

Could be!  I don't know how much of a speed boost they get, though.  While
the magical interning is done for PyObject_SetAttr(), it's not done for the
has-to-be-more-frequently-called PyObject_GetAttr(), as people call that
with all sorts of garbage strings.  For some reason interning is done for
PyObject_GetAttrString(), although the caller of that can't profit from
indirect interning (it takes a char*, not a PyObject*).

Like I said, maybe this all makes sense to Guido <0.9 wink>.

at-least-we're-not-fighting-over-what-the-comments-mean-ly y'rs  - tim