Skip to content

Commit

Permalink
Revise comment on when to use a hash table.
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bebop committed Nov 8, 2024
1 parent 277ff4b commit 95775c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/dhb/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ inline index_type tombstoneIndex() { return static_cast<index_type>(-2); };
// TODO: This could take the entry size into account.
inline bool uses_htab(size_t bsize) {
const size_t cache_line = 64;
// Each entry is typically 16 bytes or so.
// Preliminary experiments how that using the hash index is only useful if the block becomes
// larger than several cache lines (approx. 16 or so).
// Hence, the following is a reasonably good heuristic:
// Each entry is typically 16 bytes or so. Preliminary experiments show that
// using the hash index is only useful if the block becomes larger than
// several cache lines (approx. 16 or so). Hence, the following is a
// reasonably good heuristic:
return 16 * bsize > 16 * cache_line;
}

Expand Down

0 comments on commit 95775c5

Please sign in to comment.