Skip to content

Commit

Permalink
Micro optimization indexing using tuples instead of lists
Browse files Browse the repository at this point in the history
Since Python 3.X (i can't remember which) tuple concatenation like this
is fast since python inspects the tuple usage and knows that it is the
last reference and reuses the underlying c object.

The change to LazilyIndexedArray is that `shape` is repeatidely accessed
throughout the codebase (ndim, and shape are heavily used) and thus we
benefit from pre-computing this at creation time.
  • Loading branch information
hmaarrfk committed May 6, 2024
1 parent 2fd3b8b commit ebfb715
Showing 1 changed file with 96 additions and 89 deletions.
Loading

0 comments on commit ebfb715

Please sign in to comment.