Skip to content

Reduce memory usage by dropping _subgrid_*_indices #1882

Open

Description

@Sevans711

Currently, all indexing operations (including isel, sel, and subset operations) permanently store _subgrid_node_indices and _subgrid_face_indices on the resulting grid. If face_edge_connectivity has been populated in the grid, _subgrid_edge_indices get stored as well. Each of these is a 1D integer array (int64 on most machines) with the same size as the result's corresponding dimension size (n_node, n_face, n_edge), so the storage costs aren't necessarily trivial.

One option to solve this issue could be to drop these arrays from Grid._ds at the end of each indexing operation, so that they don't remain on the grid after the indexing has already been completed. Another option would be to refactor to internally pass these indices between functions, without ever attaching them to the grid in the first place. I would guess that the latter option might be slightly preferable.

Activity

  1. moved this from 📚 Backlog to 📝 To-Do in UXarray Developmenton Nov 9, 2026
  2. moved this from 📝 To-Do to On Pause in UXarray Developmenton Nov 9, 2026
  3. dylannelson commented on Nov 9, 2026

    @dylannelson
    Member

    On pause till the work in #1667 is completed to avoid conflicts and overlaps when dealing with data on the grid. I will report back here when it's done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

scalabilityRelated to scalability & performance efforts

Type

No type

Fields

Priority

Low

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions