New lockless hashtable

hashtable lockless performance

I just finished the first iteration of the new #hashtable for #cachegrand ( ), the code is in the new-lockless-hashtable-mpmc branch, it's still missing a few bits and pieces, e.g. to support the #RMW (Read-Modify-Write) operations but the standard get, upsert (insert and/or update) and delete operations have been implemented and fully tested.

I shouldn't really publish #benchmarks of unfinished components done on my (old) laptop and not production servers .... but I can't really resist!!!

The laptop is farly old, it has a 4 core, 8 thread, Intel Core i7-7820HQ CPU @ 2.90GHz and uses 2133MHZ DDR4 memory, so definitely far from what you can get your hands on a production environment.

Using 8 threads, the new hashtable is able to chew:

  • about --> 25 million inserts (all new keys) <-- per second
  • about --> 28 million updates (updating values of previously inserted keys) <-- per second!!!

The benchmark per se test very specific scenario, they are not real world use cases, but they give a pretty good indication of the maximum performances that can be achieved.

Tomorrow will run tests on an AMD EPYC 7502, I do expect about 200 million inserts and about 220/230 million updates per second, the previous iteration of the hashtable was only able to do about 85 million inserts and about 125 million updates on the same hardware.

Just for fun, I also ran the same benchmarks on a #RaspberryPI 4, which uses a 1.5GHz 4 cores #ARM cpu, (not overclocked) with very good results! Using 4 thread I got about 3 million inserts per second and about 5.1 million updates per second which, considering the hardware, are pretty good numbers!

I am really looking forward to finish to implement the required functionalities and switch to use this new hashtable in cachegrand for the indexes of the internal #database to make it even #faster!

avatar Daniele Salvatore Albano

Keep Reading...

cachegrand got featured on TheNewStack!

avatar Daniele Salvatore Albano

Here the new benchmark I promised to do on proper hardware.

avatar Daniele Salvatore Albano