-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: cache contracts before benching #254
Changes from 4 commits
ad38c92
563bb26
abf9a17
c8fe7f0
e2015ab
073f654
93f33eb
886b26b
a92c99b
e84a57f
9256c4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,9 @@ jobs: | |
with: | ||
key: "gas-bench" | ||
|
||
- name: install cargo-stylus | ||
run: cargo install [email protected] | ||
|
||
- name: install solc | ||
run: | | ||
curl -LO https://github.com/ethereum/solidity/releases/download/v0.8.24/solc-static-linux | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -13,6 +13,7 @@ async fn main() -> eyre::Result<()> { | |||||||
let report = | ||||||||
reports.into_iter().fold(Reports::default(), Reports::merge_with); | ||||||||
|
||||||||
println!(); | ||||||||
println!("{report}"); | ||||||||
Comment on lines
+18
to
19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's kinda personal. For me add or remove another line is faster, then change a specific symbol:) |
||||||||
|
||||||||
Ok(()) | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,14 @@ MYDIR=$(realpath "$(dirname "$0")") | |
cd "$MYDIR" | ||
cd .. | ||
|
||
NIGHTLY_TOOLCHAIN=${NIGHTLY_TOOLCHAIN:-nightly} | ||
NIGHTLY_TOOLCHAIN=${NIGHTLY_TOOLCHAIN:-nightly-2024-01-01} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe use a more recent nightly like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alas, recent nightly versions do not work. That is another problem why we're pinned. Also I've checked that on stable not just binary size is bigger, but benchmarks perform %2-3 worse There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think in this pr we will update |
||
cargo +"$NIGHTLY_TOOLCHAIN" build --release --target wasm32-unknown-unknown -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort | ||
|
||
export RPC_URL=http://localhost:8547 | ||
cargo run --release -p benches | ||
|
||
# No need to run benchmark infrastructure with release. | ||
# Just compilation will take longer. | ||
# Contracts already built with release. | ||
cargo run -p benches | ||
qalisander marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
echo "Finished running benches!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this can be part of
deploy
? And maybe changedeploy
's signature to receive aenum CachePolicy { None, Bid(u64) }
which determines whether we cache or not? (this may seem overengineered, but it is forward-compatible)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also
deploy_with_cache(&alice).await?
could make, sense since0
bid is always acceptable on nitro test node.But I was thinking to have it separate for now. And later add analytics of how contracts perform with cache and without it in the single report. Also to track improvements of caching separate from contracts