[issue23119] Remove unicode specialization from set objects

Raymond Hettinger report at bugs.python.org
Mon Dec 29 09:15:42 CET 2014


Raymond Hettinger added the comment:

Attaching an alternative patch that handles the unicode specific case with far less code and less overhead.  It seems to speed-up all the timings I've tried.

It keeps the unicode_eq() specific path which bypasses several unneeded steps:
* an incref/decref of the startkey
* an incref/decref of Py_True or Py_False
* Py_Enter/LeaveRecursive call overhead
* A NotImplemented check
* Various indirections, null checks, xor bool result, and several nested function calls that save and restore registers
* Test for an error result
* Test for changed table or entry
    usual incref/decref, richbool, richcmp, tablesize_change, errorcheck,
    recursion depth, check for NotImplemented, conv to PyTrue/False, incr/dec Py_True/Py_False, conv back to int
  }

----------
Added file: http://bugs.python.org/file37552/move_unicode_inside.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23119>
_______________________________________


More information about the Python-bugs-list mailing list