Skip to content

Conversation

qianbin
Copy link
Contributor

@qianbin qianbin commented Jul 28, 2022

This PR makes memdb save skiplist nodes and kvs together in one byte-slice. The performance of memdb is significantly improved with this change(it's believed that the CPU cache hit-rate goes up).

benchmarks:

$ benchstat before.txt after.txt 
name         old time/op  new time/op  delta
Put-8        1.08µs ± 1%  0.98µs ± 1%   -9.11%  (p=0.008 n=5+5)
PutRandom-8  1.86µs ± 1%  1.52µs ± 2%  -17.94%  (p=0.008 n=5+5)
Get-8        1.24µs ± 1%  1.12µs ± 1%  -10.26%  (p=0.008 n=5+5)
GetRandom-8  2.06µs ± 1%  1.67µs ± 1%  -19.01%  (p=0.008 n=5+5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant