Skip to content
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

Optimize chained hyperslab selection. #1031

Merged
merged 2 commits into from
Jul 26, 2024
Merged

Commits on Jul 26, 2024

  1. Optimize chained hyperslab selection.

    A common pattern for creating semi-unstructured selection is to use many
    (small) RegularHyperSlab and chain them:
    
    ```
    HyperSlab hyperslab;
    for(auto slab : regular_hyper_slabs) {
      hyperslab |= slab;
    }
    ```
    
    This eventually triggers calling:
    ```
    for(auto slab : regular_hyper_slabs) {
      auto [offset, stride, counts, blocks] = slab;
      H5Sselect_hyperslab(space_id, offset, stride, counts, block);
    }
    ```
    
    Measurements show that this has runtime that's quadratic in the number
    of regular hyper slabs. This starts becoming prohibitive at 10k - 40k
    slabs.
    
    We noticed that `H5Scombine_select` does not suffer from the same
    performance issue. This allows us to optimize (long) chain of `Op::Or`
    using divide and conquer.
    
    The current implementation only optimizes streaks of `Op::Or`.
    1uc committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    3aea810 View commit details
    Browse the repository at this point in the history
  2. Missing inline.

    1uc committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    94727b8 View commit details
    Browse the repository at this point in the history