Best advice is to benchmark it by yourself.
In any case, since you seem to have constant size there are other solutions:
- plain C arrays (eg.
int data[X][Y][Z]
) - plain one dimensional C array in which you compute indices by yourself, eg
X*W*H + Y*W + Z
, can be handy in some situations std::array
, which is basically a C++ array with some synctactic sugar taken from STL collectionsstd::vector
, which I guess is the first solution that can be triedboost::multi_array
, which is meant to support N dimensional arrays so it can be overkill for your purpose but probably has a better locality of data compared to a vector.