STINNER Victor <victor.stin...@gmail.com> added the comment: > With my patch (attached) codecs.utf_16_be_decode runs 5% faster (on 32-bit > Linux, I was not tested 64-bit). And of cause no pointers -- no aliasing > warnings.
Your patch is wrong: you need to use & 0xffff to get lower 16 bits when reading a UTF-16 unit. For example, (Py_UCS2)(block >> 32) should be written (Py_UCS2)((block >> 32) & 0xffff). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14249> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com