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

*: add lru cache to speed up scanning logs #302

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Mar 30, 2023

# Master:
test engine::tests::bench_engine_fetch_entries              ... bench:      23,738 ns/iter (+/- 1,027)

# This PR:
test engine::tests::bench_engine_fetch_entries              ... bench:      18,127 ns/iter (+/- 517)

It's not a fair comparison because thread local cache can only cache a block, but global lru cache can cache 256MiB. But it's just a way to show potential improvement on scanning logs.

Signed-off-by: Jay Lee <[email protected]>
Signed-off-by: Jay Lee <[email protected]>
Global cache is wrong if there are multiple raft engine or raft
engine is reopen multiple times.

Signed-off-by: Jay Lee <[email protected]>
@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Attention: Patch coverage is 94.21769% with 17 lines in your changes missing coverage. Please review.

Project coverage is 97.82%. Comparing base (39f4db4) to head (02f4c85).
Report is 33 commits behind head on master.

Files with missing lines Patch % Lines
src/cache.rs 93.51% 14 Missing ⚠️
src/engine.rs 95.08% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #302      +/-   ##
==========================================
- Coverage   97.89%   97.82%   -0.07%     
==========================================
  Files          31       32       +1     
  Lines       12228    12435     +207     
==========================================
+ Hits        11970    12164     +194     
- Misses        258      271      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Jay Lee <[email protected]>
@tonyxuqqi tonyxuqqi requested review from tabokie and hicqu April 25, 2023 06:24
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