Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize subtype checking by avoiding a nested function #14325

Merged
merged 1 commit into from
Dec 20, 2022

Commits on Dec 20, 2022

  1. Optimize subtype checking by avoiding a nested function

    Mypyc isn't good at compiling nested functions, and this one was
    in one of the hottest code paths in all of mypy. The nested
    function wasn't even used all the time, but mypyc will still
    construct a closure object every time.
    
    This adds some code duplication, but it's well worth it. Amazingly,
    this speeds up self-check by about 10%!
    
    This addresses some of the slowdown introduced in #13303. #14324
    addresses another related slowdown.
    JukkaL committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    ac480b9 View commit details
    Browse the repository at this point in the history