bpo-43014: Improve performance of tokenize by 20-30% #24311
Conversation
Great optimization, though there are 2 concerns of mine;
Maybe there is a solution that would both optimize this, and also don't cause any new regressions for normal users (something like |
I initially approached this with lru_cache, however the function call alone accounts for 6% of the execution so the performance gains aren't as significant |
Maybe we could set it to a global ( |
from my tests this performs the same as the lru_cache approach (within a few 1s of |
bc2dc35
to
2025476
15bd9ef
into
python:master
Thanks a lot @asottile! |
https://bugs.python.org/issue43014