-
Notifications
You must be signed in to change notification settings - Fork 3k
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
dialyzer: Fix slow Dialyzer run on Elixir source code #9162
base: master
Are you sure you want to change the base?
Conversation
Fix erlang#9135. Dialyzer was slow because in `dialyzer_dataflow:handle_guard_call/5`, previous way of handling opaque warnings required one extra round of binding for guards. In Elixir source code, guards in the format of `when digit in ?0..?9` can be expanded to more than 10 guards during Dialyzer's analysis, which made the inefficiency more obvious.
CT Test Results 2 files 42 suites 16m 48s ⏱️ Results for commit 41f7002. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
Nitpick: it is actually doing
This results in the following Erlang code:
|
@bjorng would you recommend it being left-side or it is all the same? IIRC it was left-side a long time ago and we changed it because Dialyzer was unhappy. :) |
Do you mean that it was right-side a long time ago? That it, like so:
My guess is that Dialyzer has not got better handling that kind of code. @lucioleKi, what do you think? |
I think Dialyzer sees both cases in different places. After this fix, I see less |
Yes. I did some digging and apparently it was a compiler issue:
Although I also remember a related Dialyzer issue. I will continue digging. EDIT: the issue is from 2012. I think we can say it is probably not worth digging deeper after all this time. |
Fix #9135. Dialyzer was slow because in
dialyzer_dataflow:handle_guard_call/5
, previous way of handling opaque warnings required one extra round of binding for guards. In Elixir source code, guards in the format ofwhen digit in ?0..?9
can be expanded to more than 10 guards during Dialyzer's analysis, which made the inefficiency more obvious.