Stefan Behnel wrote: > Lisandro Dalcin wrote: >> I do not see any semantic difference in using PyString_FromString() or >> PyString_InternFromString(). Both calls return a new reference you own >> and next have to DECREF. > > I'm not talking about a semantic difference, the interning itself is just > more > overhead, so it's not worth doing unless you know it will be payed for by > the usage later on.
To stop this discussion from taking a bikeshed planning route, I looked through the places where we currently use GetAttrString(). With the possible (!) exception of the C-API import (which can benefit from some general optimisation, but likely isn't important enough to bother), none of them is in any way performance critical, so adding the additional burden of a second dict lookup for interning is in no way rectified by whatever speedup we get *after* having interned the name that is looked up here. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
