-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Replace PyAccu with PyUnicodeWriter #95005
Comments
pyperformance has some JSON-related benchmarks. It would be good to run those in our stable benchmarking environment to confirm the performance increase before merging. I'm happy to do that if you ping me when your PR is ready for that testing. |
This is pyperformance before my changes:
And after my changes:
There is an improvement but not as big as in my 20Mb test case. |
@mdboom the PR is ready, can you run the tests? |
The results on the standard test machine corroborate your results. Before your change:
After your change:
So, a solid improvement (and of course there are other reasons to do this besides just performance...) |
PyAccu is used only in two places:
The newer PyUnicodeWriter seems to be a better tool for aggregating strings and removing PyAccu gets rid of >100 lines of C code while keeping the same functionality.
P.S. The new JSON encoder also performed ~10% better on a completely synthetic test encoding a 20Mb JSON. That JSON in turn was created while investigating the lack of concurrent execution in FastAPI services. Which turned out to be due to JSON encoding.
The text was updated successfully, but these errors were encountered: