change path to [24]byte ?
superfell opened this issue · 0 comments
superfell commented
the compressed path segment is stored as a slice in the nodeHeader type. This consumes 24 bytes, which feels like on average more than any compressed path would consume. The slice is the only thing in node that's not directly stored in the node struct.
It might be beneficial to change path to an [24]byte and store the compressed path directly in it. This wouldn't increase the size of the node, but would colocate the path in memory with the rest of the node. In the event there's a compressed path longer than 23 (need one of the bytes to store the path length) we'd have to insert an intermediate node.