Closed danielealbano closed 1 year ago
Patch coverage: 94.95
% and project coverage change: +0.15
:tada:
Comparison is base (
73325e3
) 83.01% compared to head (3264b05
) 83.15%.:exclamation: Current head 3264b05 differs from pull request most recent head 354a3f7. Consider uploading reports for the commit 354a3f7 to get more accurate results
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
This PR introduces a basic transaction support for the new mpmc hashtable:
This PR is extremely important because it introduces a blazing fast new data structure, the
slots_bitmap_mpmc
which performs extremely well under contention. The main idea is that each transaction is just a slot of the bitmap and each thread will search in this bitmap first in its own shard (as the bitmap allows localized searches) and then in the whole bitmaps as fallback.The result is that in a normal situation, where slots are available for the thread, to acquire and release 51200 slots per threads it takes just a few nanoseconds (more details in
benches/bench-slots-bitmap-mpmc.cpp
)With 4 thread and in avg 800k ops/s in total (therefore potentially 800k transactions/s) the time required would be 1.16ms, an average overhead of 1.45ns per transaction to be acquired and released meanwhile with with just 1 thread and in avg 200k ops/s would be 295us. In both cases the time to acquire and release a transaction id is close enough to zero to be considered irrelevant!