-
-
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
uncaught iterate overflow for StepRange #37876
Comments
The same holds for |
Thanks for the explanation, this makes sense to me. This issue was raised when I try to add overflow test cases and I was a bit confused about how overflow should be checked. Another aspect of not doing such eager checking, IMO, is that this terribly hurts the performance. For example, in #37829 (comment) the loop without such eager overflow checking takes about 15ns and the one with takes 37ns, which is something we don't want to pay. |
Hm, what change would you propose to improve performance generally? One issue to keep in mind is you can't assume you have a sentinel value in ranges like I don't immediately see issues in simple loops:
So yeah, you can see there's a |
Sorry for the confusing word choices, I meant to say "by removing those eager checks in my PR, the performance can be improved quite significantly" The eager cheks, though, is specific in my PR 4b47f63#diff-89e97f67f8058d32eac8d917db5bbdbfR407-R433 where I did a lot of checks on boundary and steps. Those checks can be possibily simplified into |
Oh, so you're saying adding a bunch of checks improves performance? That's interesting :p |
😂 the opposite. Adding a bunch of checks increases the time from 15ns to 37ns, which is not very acceptable for such basic operations. |
Ok, then I got it right the first time 😆. |
I believe this overflow is unwanted.
Another behavior that might be related to this:
Should this return
nothing
or(7, 7)
?Related lines are:
julia/base/range.jl
Lines 651 to 664 in 9392bbe
The text was updated successfully, but these errors were encountered: