snarkVM icon indicating copy to clipboard operation
snarkVM copied to clipboard

[Perf] Speed up locking in DataMap::atomic_checkpoint

Open ljedrz opened this issue 1 year ago • 1 comments

This is a tiny change I found while pruning my local branches, and I wouldn't want us to miss it.

The guard on atomic_batch is utilized a lot, which - in the current setup - also causes the guard on checkpoints used in the atomic_checkpoint method to be in force significantly longer than necessary.

This tiny change with no impact on logic fixes this, as confirmed by guard lifetime measurements in a --dev run; the maximum guard (on checkpoints) duration is reduced by ~75%.

ljedrz avatar Jun 26 '24 11:06 ljedrz