Skip to content

implement SubArray reindexing without using @generated #58800

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mbauman
Copy link
Member

@mbauman mbauman commented Jun 24, 2025

The tuple specialization for indexing with UnitRanges is highly optimized, type stable, and constant foldable for statically known values like these.

Seems like a very good thing to just lean on that. It's how I would've written this in the first place had that optimized method existed when I wrote it. It's much more readable and — I imagine — it should be quite a bit friendlier to the compiler. The only time you should see a performance difference here is when you have a SubArray with 11 or more indices and one of those indices is 3-dimensional or more.

The tuple specialization for indexing with UnitRanges (with up to 10 values) is highly optimized and type stable for statically known values like these.
@mbauman mbauman added the arrays [a, r, r, a, y, s] label Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant