EventStore
EventStore copied to clipboard
[DB-26-3] Open scavenged chunks quickly. Build midpoints later on demand
Changed: Open the database faster by building the midpoints for scavenged chunks later on demand
Otherwise opening a database with thousands scavenged chunks can become too slow
I have no questions about functional aspects of the proposed changes. From non-functional point of view, there are two improvements possible:
- If lock contention is rare (this is mentioned in the comments inside of the code), the same can be done in lock-free fashion
-
RequestCachingmight start calculation of midpoints in the background task for each chunk (minimal changes are required) and synchronize at its result only on demand.
On my machine, basic performance tests show at least a 10x improvement in the opening speed of scavenged chunks at startup. Previously, it was taking roughly 40ms, now it takes around 1-4ms !