|
|
|
|
|
by zephen
11 days ago
|
|
There are 5 trits. In any case, if there were 3 trits, I'm not sure what the practical difference between a single table you describe and 3 different 256 byte tables, again depending on the architecture. Yes a single table would have better cache effects for a single read, but presumably? you're doing a lot of reads in an unpacking phase. |
|
You can do a full unpacking-via-lookup with a uint16[256] and then do bit shifting and masking to extract the individual trits, but using an extra byte in each entry (or 3 tables) would let you extract with just two shifts.
This starts to vary a lot with the microarchitecture, and there’s the added dimension of SIMD vectorization, so accurate timing in a realistic context becomes important.