Message361636
Four functions in Objects/unicodectype.c copy values out of lookup tables with a for loop
int i;
for (i = 0; i < n; i++)
res[i] = _PyUnicode_ExtendedCase[index + i];
instead of a memcpy
memcpy(res, &_PyUnicode_ExtendedCase[index], n * sizeof(Py_UCS4));
My Apple clang version 11.0.0 on my Mac optimizes away the for loop and generates equivalent code to the memcpy.
gcc 4.8.5 on my Linux box (the newest GCC I have) does not optimize away the loop.
The four functions are:
_PyUnicode_ToLowerFull
_PyUnicode_ToTitleFull
_PyUnicode_ToUpperFull
_PyUnicode_ToFoldedFull |
|
Date |
User |
Action |
Args |
2020-02-08 21:45:30 | petdance | set | recipients:
+ petdance, vstinner, ezio.melotti |
2020-02-08 21:45:29 | petdance | set | messageid: <1581198329.98.0.186422149655.issue39588@roundup.psfhosted.org> |
2020-02-08 21:45:29 | petdance | link | issue39588 messages |
2020-02-08 21:45:29 | petdance | create | |
|