Skip to content

Efficient sub-cube access #80

Open
@drdnichols

Description

@drdnichols

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions