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

Switch execution to evmone baseline interpreter #619

Merged
merged 8 commits into from
Mar 25, 2022
Merged

Switch execution to evmone baseline interpreter #619

merged 8 commits into from
Mar 25, 2022

Conversation

yperbasis
Copy link
Member

@yperbasis yperbasis commented Mar 20, 2022

Switching execution from advanced to baseline evmone interpreter results in performance saving of about 1h (out of circa 1day) of the execution time. One contributing factor, I think, is that baseline CodeAnalysis is more compact than AdavancedCodeAnalysis, so the cache is significantly smaller and thus more RAM is available for MDBX page caching by the OS.

master@01158d73 baseline@a972151c
Execution done=22h 9m 42s Execution done=21h 13m 35s
master baseline

linux-x86_64, gcc 11.2.0

@codecov
Copy link

codecov bot commented Mar 21, 2022

Codecov Report

Merging #619 (b2022be) into master (01158d7) will decrease coverage by 0.04%.
The diff coverage is 68.75%.

@@            Coverage Diff             @@
##           master     #619      +/-   ##
==========================================
- Coverage   81.82%   81.78%   -0.05%     
==========================================
  Files         170      169       -1     
  Lines       14196    14206      +10     
==========================================
+ Hits        11616    11618       +2     
- Misses       2580     2588       +8     
Impacted Files Coverage Δ
core/silkworm/chain/config.hpp 100.00% <ø> (ø)
core/silkworm/common/base.hpp 100.00% <ø> (ø)
core/silkworm/execution/evm.hpp 80.00% <ø> (ø)
node/silkworm/stagedsync/stage_execution.cpp 34.04% <0.00%> (-0.09%) ⬇️
node/silkworm/stagedsync/stage_execution.hpp 100.00% <ø> (ø)
core/silkworm/execution/evm.cpp 95.35% <73.07%> (-1.34%) ⬇️
core/silkworm/chain/config.cpp 95.93% <100.00%> (-0.07%) ⬇️
core/silkworm/execution/analysis_cache.cpp 100.00% <100.00%> (ø)

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 01158d7...b2022be. Read the comment docs.

@yperbasis yperbasis changed the title [WIP] evmone baseline analysis cache Switch execution to evmone baseline interpreter Mar 25, 2022
@yperbasis yperbasis marked this pull request as ready for review March 25, 2022 10:11
@@ -84,7 +84,8 @@ StageResult Execution::forward(db::RWTxn& txn) {
prune_receipts = std::min(prune_receipts, hashstate_stage_progress - 1);
}

AnalysisCache analysis_cache;
static constexpr size_t kCacheSize{5'000};
lru_cache<evmc::bytes32, std::shared_ptr<evmone::baseline::CodeAnalysis>> analysis_cache{kCacheSize};
Copy link
Contributor

@AndreaLanfranchi AndreaLanfranchi Mar 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get this. Isn't lru_cache<evmc::bytes32, std::shared_ptr<evmone::baseline::CodeAnalysis>> the cache_ member of AdvancedAnalysisCache class ?

Copy link
Member Author

@yperbasis yperbasis Mar 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, in AdvancedAnalysisCache it's lru_cache<evmc::bytes32, std::shared_ptr<evmone::advanced::AdvancedCodeAnalysis>>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll introduce a type alias for clarity.

@yperbasis yperbasis merged commit 6fd5878 into master Mar 25, 2022
@yperbasis yperbasis deleted the baseline branch March 25, 2022 11:17
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.

2 participants