client_rust icon indicating copy to clipboard operation
client_rust copied to clipboard

Find the proper bucket before aquiring the lock

Open vkrasnov opened this issue 2 years ago • 0 comments

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.

vkrasnov avatar May 25 '23 14:05 vkrasnov