silkworm icon indicating copy to clipboard operation
silkworm copied to clipboard

Add memory-mapped file implementation

Open canepat opened this issue 3 years ago • 1 comments

This PR adds a thin memory-mapped file implementation, based on Aeron's one, as part of the Snapshot Sync functionality. The motivation for introducing this memory-mapped file lies on the performance numbers captured in its benchmark file.

Exactly for the purpose of adding performance benchmarks, this PR includes also the following changes:

  • add Google Benchmark as project dependency
  • add new benchmark_test target built collecting all the benchmark files (i.e. any source code file matching *_benchmark.cpp)

Minor customization in Hunter configuration: it is necessary not to treat warnings as errors in Google Benchmark build to avoid bug in GCC 12.1.0:

  • https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
  • https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651

canepat avatar Oct 17 '22 06:10 canepat

Codecov Report

Merging #787 (a499709) into master (b709e6f) will decrease coverage by 0.01%. The diff coverage is 79.66%.

@@            Coverage Diff             @@
##           master     #787      +/-   ##
==========================================
- Coverage   75.01%   74.99%   -0.02%     
==========================================
  Files         197      199       +2     
  Lines       14379    14438      +59     
  Branches     2285     2294       +9     
==========================================
+ Hits        10786    10828      +42     
- Misses       2620     2627       +7     
- Partials      973      983      +10     
Impacted Files Coverage Δ
node/silkworm/common/memory_mapped_file.cpp 77.35% <77.35%> (ø)
node/silkworm/common/memory_mapped_file.hpp 100.00% <100.00%> (ø)
core/silkworm/consensus/pos/engine.cpp 66.66% <0.00%> (-33.34%) :arrow_down:
node/silkworm/rpc/server/server_context_pool.cpp 60.16% <0.00%> (-2.44%) :arrow_down:
node/silkworm/rpc/completion_end_point.cpp 86.04% <0.00%> (-2.33%) :arrow_down:
core/silkworm/state/in_memory_state.cpp 92.18% <0.00%> (-0.53%) :arrow_down:
core/silkworm/execution/evm.cpp 93.59% <0.00%> (-0.25%) :arrow_down:
node/silkworm/rpc/server/call.hpp 70.85% <0.00%> (+0.57%) :arrow_up:
core/silkworm/consensus/blockchain.cpp 88.70% <0.00%> (+0.80%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Oct 17 '22 14:10 codecov[bot]