-
Notifications
You must be signed in to change notification settings - Fork 33
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
Lint takes too long on base/expr.jl #242
Comments
When I run it with
|
Thanks for this profile output. I think we need some heuristics for when to bother inferring the types of things. |
I want to point out that even just the trivial check
I'm a little surprised that typejoin can be so slow when it's clear that the answer is |
Maybe another heuristic could to be output |
Another example of a very expensive call in statictype.jl:
It's cached the second time:
I don't know why it runs on At_mul_B!, it doesn't occur directly in expr.jl. Does this mean that Lint will potentially try to infer return types of an arbitrarily large number of base functions, applied to argument types like |
It's been a while since I looked over that part of the code, but if I recall correctly, if there are undefined symbols Lint will in fact read all the files in the package (in this case, |
I suspect one problem might be that any time lint can't figure out a type of something, it ends up passing Any as the corresponding type of an argument to return_types, so it ends up with a lot of rather pointless calls like this, where return_types has little chance of giving a helpful return type:
where return_types has to look at all known methods of getindex because its first argument could be anything. |
I'm worried that blanketly refusing to infer things when some arguments are |
There is another consequence to this that I didn't notice at first, which is that if you use Lint.jl as a background checker (I use flycheck in emacs), it can eat up a lot of battery life unnoticed. |
I'm using julia's base/expr.jl (which is only 343 lines, counting comments) just as an example to do some testing on, but lintfile takes a seriously unreasonable amount of time. This makes it much harder to use Lint.jl as a plugin to a text editor, because half an hour is not nearly responsive enough.
The text was updated successfully, but these errors were encountered: