summaryrefslogtreecommitdiffstats
path: root/UsersTable.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-10-22 15:43:26 +0200
committerBenBE <BenBE@geshi.org>2020-11-17 02:01:02 +0100
commit307c34b028d353154aa268eceb38e0331c8275cf (patch)
tree25ef4307e553d0bfcda195e66f1171646641a738 /UsersTable.c
parent7914ec201ef19fa0c0caed99dc150a953eb9bc19 (diff)
Hashtable: use dynamic growth and use primes as size
Dynamically increase the hashmap size to not exceed the load factor and avoid too long chains. Switch from Separate Chaining to Robin Hood linear probing to improve cache locality. Use primes as size to further avoid collisions. E.g. on a standard kde system the number of entries in the ProcessTable might be around 650.
Diffstat (limited to 'UsersTable.c')
-rw-r--r--UsersTable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/UsersTable.c b/UsersTable.c
index 25e44883..fdbfd68f 100644
--- a/UsersTable.c
+++ b/UsersTable.c
@@ -20,7 +20,7 @@ in the source distribution for its full text.
UsersTable* UsersTable_new() {
UsersTable* this;
this = xMalloc(sizeof(UsersTable));
- this->users = Hashtable_new(20, true);
+ this->users = Hashtable_new(10, true);
return this;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy