Efficient sub-cube access
- 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
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