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, eric.snow, lemburg, pitrou, rhettinger, serhiy.storchaka, vstinner
Date 2013-08-15.05:33:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376544830.0.0.728763429384.issue17628@psf.upfronthosting.co.za>
In-reply-to
Content
The dont-compare-first-last patch looks about right.

The "if (len == 0) return 1;" shortcut perhaps should be taken out.  It makes the common case pay (if only slightly) for the rare case (which of course, never gets predicted).  This whole code block gets inlined in the very tight inner loops of the set/dict lookkey functions -- it should be as thin as possible.

One other thing to take a look at is the "PyUnicode_GET_LENGTH(a) * PyUnicode_KIND(a)" expression.  The disassembly shows an imulq instruction rather than the usual scaled LEA computation.  I don't know if this can be sped-up by a predictable branch for the common case.
History
Date User Action Args
2013-08-15 05:33:50rhettingersetrecipients: + rhettinger, lemburg, pitrou, vstinner, christian.heimes, eric.snow, serhiy.storchaka
2013-08-15 05:33:50rhettingersetmessageid: <1376544830.0.0.728763429384.issue17628@psf.upfronthosting.co.za>
2013-08-15 05:33:49rhettingerlinkissue17628 messages
2013-08-15 05:33:49rhettingercreate