-
-
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
Code snippet runs 6x slower (and allocates 6x as much) on 0.5.0-rc2 than on 0.4.6 #18129
Comments
All the better – these kinds of regressions are the hardest to find. Thanks! |
This has the same root cause as #16047. With closures, there are many subtly different cases involving how variables are used, and we can optimize some and not others. The good news is that if you're able to work around the issue or we can fix this case, 0.5 is indeed expected to be 10x faster than 0.4 on code like this. The recipe for working around this is to run
and then you get the 10x faster performance. |
fix #18129, optimize some more cases of captured variables
…ables"" This reverts commit d45bcae.
Julia 0.5.0-rc2 allocates about 6x more than Julia 0.4.6 per inner loop iteration in
cheapest_insertion
in the following (should be copy-paste runnable):Typical 0.5.0-rc2 output:
Typical 0.4.6 output:
Pinging @JeffBezanson who seemed interested in the julia-users discussion. Note as well that this performance regression is "fragile:" little changes to the code seem to make the regression disappear - this is why I couldn't find a more minimal example. E.g. changing the return of
cheapest_insertion
toreturn 47
has Julia 0.4.6 allocating the same number of bytes and running the same amount of time, but with that change Julia 0.5.0-rc2 runs 10x faster than 0.4.6.The text was updated successfully, but these errors were encountered: