This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steve.dower
Recipients christian.heimes, ezio.melotti, methane, miss-islington, mpaolini, ncoghlan, pablogsal, rhettinger, serhiy.storchaka, steve.dower
Date 2019-07-30.15:18:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1564499930.68.0.408860112126.issue37587@roundup.psfhosted.org>
In-reply-to
Content
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...)
History
Date User Action Args
2019-07-30 15:18:50steve.dowersetrecipients: + steve.dower, rhettinger, ncoghlan, christian.heimes, ezio.melotti, methane, serhiy.storchaka, mpaolini, pablogsal, miss-islington
2019-07-30 15:18:50steve.dowersetmessageid: <1564499930.68.0.408860112126.issue37587@roundup.psfhosted.org>
2019-07-30 15:18:50steve.dowerlinkissue37587 messages
2019-07-30 15:18:50steve.dowercreate