Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Feature or enhancement
Proposal:
Most JSON strings consist solely of ASCII characters that don’t require escaping, so adding a fast path for those would make a big difference. In these cases, we can avoid allocating a new string by writing the original string directly:
PyUnicodeWriter_WriteChar(writer,'"')PyUnicodeWriter_WriteStr(writer,pystr)// original stringPyUnicodeWriter_WriteChar(writer,'"')
Benchmarks have shown that this roughly 2.2x faster, see PR.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Done