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 alex, rhettinger, serhiy.storchaka, vstinner
Date 2013-08-13.01:28:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376357330.7.0.618391391852.issue18719@psf.upfronthosting.co.za>
In-reply-to
Content
Profiling the test suite shows that the short-cut branch NEVER gets taken.
There are no cases where the string lengths, kinds, and 64-bit hashes match, but the stings themselves are a mismatch.  The whole theory behind this optimization is invalid.  The first characters always match, so you don't need to test for them.

Alex, these things are very difficult to measure because the cost of a 100% predictable branch is also zero in a tight benchmark.  The negative effects of useless tests are subtle and indirect (i.e. blowing other useful things out of the branch prediction table).

Victor, thanks for link to 17628.  I will look at that further, but at first glance it looks like you're introducing a big wall of code right in the middle of a critical loop in code the is supposed to be in-lined.  It too smells of a false optimization and places far too much hope that memcmp, case-statements, and whatnot will behave awesomely will all compilers.

Unless you object, I'm going to go ahead and remove the bogus test.
History
Date User Action Args
2013-08-13 01:28:50rhettingersetrecipients: + rhettinger, vstinner, alex, serhiy.storchaka
2013-08-13 01:28:50rhettingersetmessageid: <1376357330.7.0.618391391852.issue18719@psf.upfronthosting.co.za>
2013-08-13 01:28:50rhettingerlinkissue18719 messages
2013-08-13 01:28:50rhettingercreate