[issue37587] JSON loads performance improvement for long strings

Inada Naoki report at bugs.python.org
Tue Jul 30 11:35:10 EDT 2019


Inada Naoki <songofacandy at gmail.com> added the comment:

Since scope of "c" is very wide, and there is even `&c` in the scope, compiler stores the `c` to stack every time on:

  c = PyUnicode_READ(kind, buf, next);

That is the bottleneck.  `if (strict && ...)` is not the bottleneck.

My patch used a new variable with tight scope so compiler can bypass store it to the stack.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37587>
_______________________________________


More information about the Python-bugs-list mailing list