-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Using the public PyUnicodeWriter C API made the json module slower #133968
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
Comments
See also #133186. |
Don't call PyObject_Str() if the input type is str.
Don't call PyObject_Str() if the input type is str.
…H-133969) Don't call PyObject_Str() if the input type is str. (cherry picked from commit fe9f6e8) Co-authored-by: Victor Stinner <[email protected]>
) (#133971) gh-133968: Add fast path to PyUnicodeWriter_WriteStr() (GH-133969) Don't call PyObject_Str() if the input type is str. (cherry picked from commit fe9f6e8) Co-authored-by: Victor Stinner <[email protected]>
Replace most PyUnicodeWriter_WriteUTF8() calls with PyUnicodeWriter_WriteASCII().
Replace most PyUnicodeWriter_WriteUTF8() calls with PyUnicodeWriter_WriteASCII().
Could you try overoptimizing
|
I don't know how to guarantee that.
Why do you want to limit the size to sizeof(size_t)? Which kind of optimization are you thinking of? find_first_nonascii() already takes care of the different cases with different optimizations. ascii_decode() is already highly optimized. |
I modified the json module to replace the private _PyUnicodeWriter C API with the public PyUnicodeWriter C API:
Problem: it made the json module slower. Let's investigate what's going on.
Linked PRs
The text was updated successfully, but these errors were encountered: