Micro-optimize type indirection visitor by JukkaL · Pull Request #19460 · python/mypy
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%.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters