Value array element size represented as log2

John Rose john.r.rose at
Tue Oct 2 22:16:21 UTC 2018

On Oct 2, 2018, at 10:00 AM, Ioi Lam <ioi.lam at> wrote:
> Are we sure this is needed? C++ packs arrays with alignment of sizeof(elem), and it seems to do fine …

That's not true; C++ packs to alignof(elem) which can be much smaller.
A struct of 5 bytes has no padding, no fragmentation.  That is the standard for C.

> For performance, do we worry about random access to arrays, or counted loops?

Counted loops dominate, as your example shows.

— John

More information about the valhalla-dev mailing list