Andy Lester added the comment:
Thanks for replying. I figured that might be the case, which is why I made a
ticket before bothering with a pull request.
I've also seen this kind of thing around:
i = ctx->pattern[0];
Py_ssize_t groupref = i+i;
instead of
Raymond Hettinger added the comment:
In the past, we've also gotten some gains by replacing memcpy() with for-loops.
These kinds of optimization choices are best left to the compiler.
--
nosy: +rhettinger
resolution: -> rejected
stage: -> resolved
status: open -> closed
New submission from Andy Lester :
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,