typedef struct {
const BYTE* levelUp;
const BYTE* nextTry;
} selectNextHop_t;
(apart from obvious using offets instead of pointers) you could cache the next (MINMATCH+1) byte of the sequence
typedef struct {
const int32 levelUp: 28;
const int32 nextTry: 28;
int8 nextByte: 8;
} selectNextHop_t;
while promoting to the next level the nextByte should be updated to keep the next-next symbol (symbol at MINMATCH+LEVEL offset).
While searching you will start from comparing with the nextByte from the structure (and that value will be different in most cases).
And I believe in theory that can signifinactly reduce the amount of memory jumps into the buffer and improve performance π
(apart from obvious using offets instead of pointers) you could cache the next (MINMATCH+1) byte of the sequence
while promoting to the next level the nextByte should be updated to keep the next-next symbol (symbol at MINMATCH+LEVEL offset).
While searching you will start from comparing with the nextByte from the structure (and that value will be different in most cases).
And I believe in theory that can signifinactly reduce the amount of memory jumps into the buffer and improve performance π