mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 04:34:35 +03:00
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.
This commit is contained in:

committed by
BenBE

parent
7914ec201e
commit
307c34b028
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user