You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* HeaderMap: Store pos and hash as u16
HeaderMap currently truncates all hashes to 16 bits, and limits its
capacity to 32768 elements. The comments say this is done in order to
store positions and hashes as u16, to improve cache locality. However,
they are currently stored as usize. This patch changes the code to
match the comments.
This does not appear to cause any measurable improvement or regression
in speed in the HeaderMap benchmarks. However, it should at least reduce
the memory footprint of every Headermap.
* Fix overflow check for raw capacity.
The actual maximum capacity is 24578 (i.e. `32768 * 3/4`).
A higher number would cause the raw capacity (i.e. `capacity +
capacity/3` rounded to the next power of 2) to overflow `u16`.
0 commit comments