Message195234
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. |
|
Date |
User |
Action |
Args |
2013-08-15 05:33:50 | rhettinger | set | recipients:
+ rhettinger, lemburg, pitrou, vstinner, christian.heimes, eric.snow, serhiy.storchaka |
2013-08-15 05:33:50 | rhettinger | set | messageid: <1376544830.0.0.728763429384.issue17628@psf.upfronthosting.co.za> |
2013-08-15 05:33:49 | rhettinger | link | issue17628 messages |
2013-08-15 05:33:49 | rhettinger | create | |
|