The formulaic responses give it away.
The formulaic responses give it away.
redixhumayun.github.io/performance/...
redixhumayun.github.io/performance/...
It isn't enough to have contiguous memory access, you also need to be aware of the cache hardware and how many entries can fit per cache line.
It isn't enough to have contiguous memory access, you also need to be aware of the cache hardware and how many entries can fit per cache line.
Also, using u64 instead of Strings leads to better performance since Strings are always heap allocated
Also, using u64 instead of Strings leads to better performance since Strings are always heap allocated
With chaining, we only have pointers which are 8 bytes each so that's 8 per cache line in a 64 byte cache line
With open addressing, it's 24 bytes each so that's 2 per cache line with padding
With chaining, we only have pointers which are 8 bytes each so that's 8 per cache line in a 64 byte cache line
With open addressing, it's 24 bytes each so that's 2 per cache line with padding
Open addressing ends up performing better but that's only due to fewer overall instructions
Open addressing ends up performing better but that's only due to fewer overall instructions
This should be more cache friendly since the entire memory is contiguously allocated
This should be more cache friendly since the entire memory is contiguously allocated
Fragmented memory should theoretically lead to poorer cache performance.
Fragmented memory should theoretically lead to poorer cache performance.