-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Speed up TypeQuery #7128
Comments
hi @JukkaL i want to work on can you assign it to me |
can you please let me know how to get started |
@mridullpandey I've assigned this to you. Here are some hints:
|
I just opened a PR with my attempt at In your first description of the issue, you wrote:
I wanted to try that out too. Line 257 in ec76cca
by a new type of object that can be compiled by mypyc? There would still have to be a callable method someplace in that object, right? |
Hi there I am Shivam, I know Python to an intermediate level, |
@Hyperion101010 There already is an open PR here: #9604. However, it's not clear if it speeds things up significantly. If you want to help, you can try measuring the impact of the PR on performance. Note that if the difference is small, you may need a specialized environment, such as a machine where you've turned off turbo boost for a constant CPU frequency, and where you've disabled most background processes. |
mypy.type_visitor.TypeQuery
is constructed often with theany
orall
builtin function as an argument. The function is used as a callable inside the query. Calling callable variables is kind of slow when compiled with mypyc. Since type queries are used a lot, switching to an integer constant or a compiled object instead of a callable could speed up runtimes measurably, perhaps by as much as 0.5% or so (random guess). Since the optimization is pretty simple, this may be worth doing.Discussion:
self.strategy([])
since it's used a lot.The text was updated successfully, but these errors were encountered: