snarkVM icon indicating copy to clipboard operation
snarkVM copied to clipboard

[Perf] Don't allocate all rocksdb keys

Open ljedrz opened this issue 1 year ago • 0 comments

Most of the rocksdb keys are relatively small, and we can avoid allocating them by using a SmallVec. Based on the heap profiles jemalloc is able to reuse this memory, but it costs CPU time to do so; also, such a change will reduce the number of (alloc-related) syscalls in non-Linux nodes.

The size was chosen to be 64B, as this covers the most common key sizes (including the prefixes).

ljedrz avatar May 07 '24 08:05 ljedrz