-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Perf regression caused by #5474 #5514
Comments
ilevkivskyi
added a commit
that referenced
this issue
Sep 12, 2018
Fixes #5514 The root cause is that #5474 added `type_parameter_checker` (a function) as one of the keys of subtype kinds. This function is a nested one, so in fact a _new_ function was created on every call to `is_subtype_ignoring_tvars()` causing many thousands parasitic keys created in subtype caches. In addition there are two smaller things listed below. The performance win is around 5% This PR: * Moves the mentioned function to global scope, this causes only 6 subtype kinds present during self-check. * Prevents similar regressions in future by switching only boolean flags as subtype kind keys. * Removes two one liners that stay in a very hot code path (cache lookup is hit 140K times during self-check). * Avoids creation of empty sets on cache look-up, create them only when writing to cache.
ilevkivskyi
added a commit
that referenced
this issue
Sep 12, 2018
Fixes #5514 The root cause is that #5474 added `type_parameter_checker` (a function) as one of the keys of subtype kinds. This function is a nested one, so in fact a _new_ function was created on every call to `is_subtype_ignoring_tvars()` causing many thousands parasitic keys created in subtype caches. In addition there are two smaller things listed below. The performance win is around 5% This PR: * Moves the mentioned function to global scope, this causes only 6 subtype kinds present during self-check. * Prevents similar regressions in future by switching only boolean flags as subtype kind keys. * Removes two one liners that stay in a very hot code path (cache lookup is hit 140K times during self-check). * Avoids creation of empty sets on cache look-up, create them only when writing to cache.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks likes #5474 caused a perf regression to the tune of 5% on a self check and in our internal repos.
@ilevkivskyi said he had an idea for fixing
The text was updated successfully, but these errors were encountered: