AK: Reduce HashTable's load factor to 70%

Measurements on my device have shown HashTable lookups and inserts to be
faster up to ~20%, at the cost of 10-20% more memory usage depending on
the exact amount of buckets.
This commit is contained in:
Jelle Raaijmakers
2026-02-20 15:44:19 +01:00
committed by Andreas Kling
parent 1745926fc6
commit 2522aad8b7
Notes: github-actions[bot] 2026-02-20 21:48:44 +00:00

View File

@@ -120,7 +120,7 @@ private:
template<typename T, typename TraitsForT, bool IsOrdered>
class HashTable {
static constexpr size_t grow_capacity_at_least = 8;
static constexpr size_t grow_at_load_factor_percent = 80;
static constexpr size_t grow_at_load_factor_percent = 70;
static constexpr size_t grow_capacity_increase_percent = 60;
struct StoredHash {