client_rust
client_rust copied to clipboard
Find the proper bucket before aquiring the lock
Currently to find the correct bucket the code has to iterate over the buckets in order under a RWLock. This however takes some time and creates lock contention in heavily threaded access which can be significantly reduced if the correct bucket is found before the lock is aquired. This change creates a copy of the buckets outside the lock and iterates over it instead. Thus the only operations under lock would be the three additions.