Skip to content

memdb: merge nodeData and kvData to speedup access#416

Open
qianbin wants to merge 1 commit intosyndtr:masterfrom
qianbin:speedup-memdb
Open

memdb: merge nodeData and kvData to speedup access#416
qianbin wants to merge 1 commit intosyndtr:masterfrom
qianbin:speedup-memdb

Conversation

@qianbin
Copy link
Copy Markdown
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