llnl / llnl/zfp

Efficient sub-cube access

Open
#80 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
885
Forks
181
PR merge metrics
No merged PRs in 30d

Description

I would like to have a fast sub-cube access to a raw buffer from the C++ array classes.
I note that for the whole cube looping over the elements is 2-3x slower than using get(Scalar *p).

The view logic isnt faster as it basically ends up going through the same point-by-point accessors.

I implemented a in function (in zfparray3.h) that has the signature
get(Scalar *p, uint sub_x, unit sub_y, uint sub_z, uint sub_nx, uint sub_ny, uint sub_nz )

This uses the same strategy as get(Scalar *p) and visits each block only one and gets all the juice out of that block. It is a similar speed to the full cube get().

From a style point of view it would be nicer to have a view::get(Scalar *p) interface.
I.e. "just get the uncompressed bytes for this view". However view doesn't really have access to all the cache representation inside the array class.

Does anyone have suggestions for the cleanest way to do this?

Contributor guide

Open the contributing guide

Research direction

Start in zfparray3.h and compare the existing get(Scalar *p) path with the proposed sub-cube signature. Consider how a view::get(Scalar *p) interface could access the array's cache representation without repeating point-by-point access. Done should be a settled API design that provides fast raw-buffer access for a sub-cube or view.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.