mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-04 17:04:18 +01:00
The write and read sets in Transaction use SkipSet, which is thread-safe. Therefore, drop the RwLock wrapping Transaction everywhere, increasing MVCC throughput by almost 30%. Before: ``` Running write throughput benchmark with 1 threads, 1000 batch size, 1000 iterations, mode: Mvcc Database created at: write_throughput_test.db Thread 0: 1000000 inserts in 6.50s (153927.21 inserts/sec) === BENCHMARK RESULTS === Total inserts: 1000000 Total time: 6.50s Overall throughput: 153758.85 inserts/sec Threads: 1 Batch size: 1000 Iterations per thread: 1000 ``` After: ``` Running write throughput benchmark with 1 threads, 1000 batch size, 1000 iterations, mode: Mvcc Database created at: write_throughput_test.db Thread 0: 1000000 inserts in 5.10s (195927.13 inserts/sec) === BENCHMARK RESULTS === Total inserts: 1000000 Total time: 5.11s Overall throughput: 195663.94 inserts/sec Threads: 1 Batch size: 1000 Iterations per thread: 1000 ```