-
Notifications
You must be signed in to change notification settings - Fork 42
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
Propagate iteration to parent in OffsetArrays #257
Conversation
Codecov Report
@@ Coverage Diff @@
## master #257 +/- ##
==========================================
+ Coverage 95.41% 95.43% +0.02%
==========================================
Files 5 5
Lines 436 438 +2
==========================================
+ Hits 416 418 +2
Misses 20 20
Continue to review full report at Codecov.
|
It really would be nice not to have to specialize so many things on OffsetArray. The more methods we have, the less generic we are. #255 (comment) seems like it needs a decision before we do things like this. |
This is unrelated to bounds-checking though, and may be addressed independent of #255. This seems to be a necessary addition at least for ranges, and may be version-limited if |
My point is that it's better to address these by private methods or traits; we don't want to overload every exported function in Base specifically for OffsetArrays, that would be a nightmare. As much as possible, we should give them the generic interface and then let the generic implementations handle them. I recognize that may not always be possible, but that should be the goal. |
Another approach: what is the specific source of the poor performance on master? Can we fix it there instead? |
That might be possible using a trait-based approach similar to #255. Perhaps the source of this difference, at least for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In light of JuliaLang/julia#41968 (review), I'm changing my recommendation here.
Sorry it took me a while to get to this. I was consumed by JuliaLang/julia#42016, which if it's not entirely misguided (:question:) should be a very impactful change for the whole ecosystem.
This provides a performance boost, especially for range indices but also to some extent for array indices.
On master
After this PR
It's interesting that an
OffsetArray(::StepRange)
index leads to faster indexing than with aStepRange
index (although the difference appears smaller on nightly).