bpo-37587: Make json.loads faster for long strings (GH-14752)
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).
M
Marco Paolini committed
8a758f5b99c5fc3fd32edeac049d7d4a4b7cc163
Parent: 9211e2f
Committed by Nick Coghlan <ncoghlan@gmail.com>
on 7/30/2019, 2:16:34 PM