Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.8] bpo-37587: Make json.loads faster for long strings (GH-14752) #15022

Merged
merged 1 commit into from
Jul 30, 2019

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