| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Specialize iteration for the concrete types `list` and `tuple`, since this is faster than iterating over an abstract iterable in compiled code. Duplicate some very hot code in the hopes further improving preformance slightly, through inlining and possibly also better branch prediction. This is a part of a set of micro-optimizations that improve self check performance by ~5.5%.
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Sorry, something went wrong.
There was a problem hiding this comment.
Interesting, I would never guess this is a hot code path.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Specialize iteration for the concrete types list and tuple, since this is faster than iterating over an abstract iterable in compiled code. Also avoid constructing many temporary lists.
Duplicate some very hot code in the hopes further improving performance slightly, through inlining and possibly also better branch prediction.
The approach is similar to what I used in #19459.
This is a part of a set of micro-optimizations that improve self check performance by ~5.5%.