-
-
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
regression in performance of counting loops #5469
Comments
This is certainly due to 0860767. |
Any hope for improvement? |
Yes, this can be fiddled with, and we might overhaul integer ranges partly for this purpose. |
I have been digging deeply into this today. The way we lower iteration may be interfering with LLVM's ability to recognize loop idioms. The following code is slow:
And simply moving
|
It looks like, with state = 1
while state != l+1
i = state
state += 1
n += x[i]*x[i]
m = ifelse(x[i] < m, x[i], m)
end I seem to get the same performance as with |
Cool! |
Please verify. Worryingly, this varies a bit by machine, but it's either the same or faster on both machines I've tried so far. |
Confirmed back to 0.2 timings on my machine. |
Very nice. |
I was playing around with an example for the class I'm preparing and noticed a 30% performance regression in the following code from 0.2 to master:
Julia 0.2:
elapsed time: 0.101895311 seconds (6912 bytes allocated)
Julia master:
elapsed time: 0.135729463 seconds (6812 bytes allocated)
The text was updated successfully, but these errors were encountered: