Message348748
While you're testing patches, can you try this version too?
Py_UCS4 c = 0, minc = 0x20;
for (next = end; next < len; next++) {
c = PyUnicode_READ(kind, buf, next);
if (c == '"' || c == '\\') {
break;
}
minc = c < minc ? c : minc;
}
if (strict && minc <= 0x1f) {
raise_errmsg("Invalid control character at", pystr, next);
goto bail;
}
When we tried this, the conditional expression became a "cmovl" operator which removed 3-4 branches from within the loop entirely, and it was 18% better than the baseline (which has now moved...) |
|
Date |
User |
Action |
Args |
2019-07-30 15:18:50 | steve.dower | set | recipients:
+ steve.dower, rhettinger, ncoghlan, christian.heimes, ezio.melotti, methane, serhiy.storchaka, mpaolini, pablogsal, miss-islington |
2019-07-30 15:18:50 | steve.dower | set | messageid: <1564499930.68.0.408860112126.issue37587@roundup.psfhosted.org> |
2019-07-30 15:18:50 | steve.dower | link | issue37587 messages |
2019-07-30 15:18:50 | steve.dower | create | |
|