This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients christian.heimes, gvanrossum, rhettinger
Date 2007-12-09.22:39:10
SpamBayes Score 0.004784313
Marked as misclassified No
Message-id <1197239951.49.0.522047356998.issue1564@psf.upfronthosting.co.za>
In-reply-to
Content
Which is the common case in Py3k, to have strings or unicode?  By 
trying to catch both, you slow down the optimization.  Also, the 
new "hash_fast" introduces function call overhead in previously in-
lined code.

My preference is to knock-out the optimization or leave in the way it 
is.  Remember, strings already cache their hash codes and that 
optimization is being short-circuited here.

For sets, I prefer the code to be left as it is.  For dicts, whatever 
you do, don't slow-down the common case of regular attribute lookup.  
This is some of the most time critical code in the language.  Trying to 
generalize the optimization, make actually make it slower.

If unicode strings are the norm and an not PyString_Objects, then 
switch to that one, but I don't think you should try to do both.
History
Date User Action Args
2007-12-09 22:39:11rhettingersetspambayes_score: 0.00478431 -> 0.004784313
recipients: + rhettinger, gvanrossum, christian.heimes
2007-12-09 22:39:11rhettingersetspambayes_score: 0.00478431 -> 0.00478431
messageid: <1197239951.49.0.522047356998.issue1564@psf.upfronthosting.co.za>
2007-12-09 22:39:11rhettingerlinkissue1564 messages
2007-12-09 22:39:11rhettingercreate