Speed up new backtracking parser #2727
Labels
C: parser
How we parse code. Or fail to parse it.
C: performance
Black is too slow. Or too fast.
T: enhancement
New feature or request
The current revision of the new backtracking parser (that gets enabled with
-t py310
) is kind of slow.For regular inputs that only use
match
/case
without using the pattern matching statements, it is somewhere between 3 to 4 X slower at the moment (going up to 6 or 7 on hand crafted inputs). On some inputs (likeLib/test/test_patma.py
) that containmatch
/case
hundreds of times, with new PEP 634 statements, it takes multiple minutes (2 minutes 34 seconds
to be exact) to format these.I don't know if there is any definite way to speed-up these, but I have an idea which I'll post shortly as a draft PR.
The text was updated successfully, but these errors were encountered: