-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
json.dumps(ensure_ascii=False) is ~10x slower than json.dumps() #67395
Comments
I prefer ensure_ascii=False because it's efficient. On Python 3.4.2: In [4]: %timeit json.dumps([{'hello': 'world'}]*100, ensure_ascii=False) On Python HEAD with attached patch: In [3]: %timeit json.dumps([{'hello': 'world'}]*100, ensure_ascii=False) |
I've copied test_encode_basestring_ascii.py and modify it for this patch. |
Patch update. |
Thank you for the patch! I posted a review. |
I've updated patch to use PyUnicode_MAX_CHAR_VALUE(). |
test_encode_basestring_ascii.py has duplicated test cases. |
I get the following compile error: In file included from ./Include/Python.h:48:0, Fixing it is trivial, I can do it when committing. |
The patch was committed in b312b256931e. Thank you! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: