Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memdb: merge nodeData and kvData to speedup access #416

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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