EventStore icon indicating copy to clipboard operation
EventStore copied to clipboard

[DB-26-3] Open scavenged chunks quickly. Build midpoints later on demand

Open timothycoleman opened this issue 1 year ago • 2 comments

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

timothycoleman avatar Mar 28 '24 12:03 timothycoleman

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
  • RequestCaching might start calculation of midpoints in the background task for each chunk (minimal changes are required) and synchronize at its result only on demand.

sakno avatar Mar 28 '24 18:03 sakno

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 !

shaan1337 avatar May 14 '24 06:05 shaan1337