tikv / raft-engine

A persistent storage engine for Multi-Raft log
Apache License 2.0
565 stars 88 forks source link

Add a thread local block cache to improve read performance #194

Closed tabokie closed 2 years ago

tabokie commented 2 years ago

Micro-benchmark of fetching 100 entries from page cache:

Without block cache:
test engine::tests::bench_engine_fetch_entries              ... bench:     215,308 ns/iter (+/- 20,738)
test engine::tests::bench_engine_fetch_entries              ... bench:     215,171 ns/iter (+/- 25,321)

With block cache:
test engine::tests::bench_engine_fetch_entries              ... bench:      57,549 ns/iter (+/- 5,163)
test engine::tests::bench_engine_fetch_entries              ... bench:      54,762 ns/iter (+/- 4,250)
codecov[bot] commented 2 years ago

Codecov Report

Merging #194 (259311e) into master (3763d26) will increase coverage by 0.02%. The diff coverage is 98.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #194      +/-   ##
==========================================
+ Coverage   96.90%   96.93%   +0.02%     
==========================================
  Files          28       28              
  Lines        7408     7478      +70     
==========================================
+ Hits         7179     7249      +70     
  Misses        229      229              
Impacted Files Coverage Δ
src/engine.rs 97.06% <97.22%> (-0.02%) :arrow_down:
src/filter.rs 82.50% <100.00%> (+0.58%) :arrow_up:
src/log_batch.rs 97.67% <100.00%> (+0.10%) :arrow_up:
src/codec.rs 98.67% <0.00%> (+0.33%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3763d26...259311e. Read the comment docs.