-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Evaluating mul!
in REPL is slow
#36860
Comments
Did a small bisect using some nightlies I downloaded. Commit 109dee7 is good, commit 3d97a82 is bad. |
On nightly: julia> @time methods(mul!);
3.086545 seconds (5.46 M allocations: 513.957 MiB, 1.59% gc time) This is not dependent on compilation, it happens even if you re-execute it. |
This makes sense --- there is a new implementation of finding matching methods, and it (1) is optimized for returning a small number of matches (as happens during inference), and (2) can be a bit super-linear, so it takes a while to return all methods. Can maybe be fixed by adding a fast path for |
Oh wow, I knew that function was causing severe performance problems whenever someone did method insertion during code loading (which was improved by #35983), but not that it hit this quite so bad. The main problem is that whoever wrote this code ("generic function with 154 methods") is having it remove any ambiguous methods from that count. Just counting them would be far easier:
But from looking into a bit in the past, it appeared that these performance problems are all rooted in #36951, and are now being surfaced more clearly in one place, instead of being spread out over a couple places. |
Closed by #38065. |
In version 1.4.2, the following is evaluated pretty much instantly:
However, in the latest nightly build from commit f130d9b, the
mul!
takes multiple seconds to evaluate.The text was updated successfully, but these errors were encountered: