snarkVM
snarkVM copied to clipboard
[Perf] Don't allocate all rocksdb keys
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).