Skip to content

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 30, 2019

When scanning the string, most characters are valid, so
checking for invalid characters first means never needing
to check the value of strict on valid strings, and only
needing to check it on invalid characters when doing
non-strict parsing of invalid strings.

This provides a measurable reduction in per-character
processing time (~11% in the pre-merge patch testing).
(cherry picked from commit 8a758f5)

Co-authored-by: Marco Paolini mpaolini@users.noreply.github.com

https://bugs.python.org/issue37587

When scanning the string, most characters are valid, so
checking for invalid characters first means never needing
to check the value of strict on valid strings, and only
needing to check it on invalid characters when doing
non-strict parsing of invalid strings.

This provides a measurable reduction in per-character
processing time (~11% in the pre-merge patch testing).
(cherry picked from commit 8a758f5)

Co-authored-by: Marco Paolini <mpaolini@users.noreply.github.com>
@miss-islington
Copy link
Contributor Author

@mpaolini and @ncoghlan: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 9265a87 into python:3.8 Jul 30, 2019
@miss-islington miss-islington deleted the backport-8a758f5-3.8 branch July 30, 2019 14:37
@miss-islington
Copy link
Contributor Author

@mpaolini and @ncoghlan: Status check is done, and it's a success ✅ .

2 similar comments
@miss-islington
Copy link
Contributor Author

@mpaolini and @ncoghlan: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor Author

@mpaolini and @ncoghlan: Status check is done, and it's a success ✅ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants