-
Notifications
You must be signed in to change notification settings - Fork 1
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
Benchmark feature #31
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JulianGCalderon
force-pushed
the
benchmark-feature
branch
from
July 11, 2024 16:47
03ea721
to
495f92f
Compare
JulianGCalderon
force-pushed
the
benchmark-feature
branch
3 times, most recently
from
July 11, 2024 17:23
03ac734
to
719b717
Compare
JulianGCalderon
requested review from
edg-l,
igaray,
azteca1998 and
fmoletta
as code owners
July 11, 2024 18:03
This was referenced Jul 11, 2024
pefontana
approved these changes
Jul 15, 2024
edg-l
approved these changes
Jul 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
BenchBlockRange
Command to Replay crate under the Benchmark features.The command is used to measure the performance of Cairo Native without the overhead of rpc requests. Caching native compilation is not yet possible in the current blockifier version
Supersedes #12
Overview
The bench block range command has roughly three distinct steps:
n
times. This third step won't make any rpc call as all data has already been cached.The benchmark command ended up being quite lengthy, so I left the high level command implementation in
main.rs
and put the inner details inbenchmark.rs
execute_tx_with_blockifier
Internally, both
execute_tx_configurable
andexecute_tx_configurable_with_state
depended on our rpc state reader, bypassing the cached state. When executing transaction for benchmarking, I needed it to be indepent of the inner state reader:CachedState<impl StateReader>
. To solve this I made a new functionexecute_tx_with_blockifier
, that does not depend on our rpc state and is just a wrapper around blockifier execution. It receives all contextual information to execute the transaction.execute_tx_configurable_with_state
could be replaced by this new function. I didn't do it in this PR to avoid having to many changes.OptionalStateReader
To ensure that no requests are made when benchmarking, an
OptionalStateReader
was used instead of ourStateReader
. This reader can be disabled so that it panics if it is attempted to read from when benchmarkingBenchmark Result in the Server
I benchmarked a single run of block 606173 in `starknet-benchmarks'. It contains 28 transactions.