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

[benchmark] Make paranoid mode configurable #15900

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions aptos-move/replay-benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,12 @@ of transactions. Typically, you want to have the concurrency level to match the
multiple concurrency levels are provided, the benchmark reports the measurements for each level.
This way it is possible to see how concurrency affects the runtime.

Finally, in order to differentiate between cold and warm starts, there is an option to skip the
measurement for the first few blocks. By specifying `--num-block-to-skip N`, the tool will ignore
measurements for the first `N` blocks (the blocks will still be executed as a "warm-up").
In order to differentiate between cold and warm starts, there is an option to skip the measurement
for the first few blocks. By specifying `--num-block-to-skip N`, the tool will ignore measurements
for the first `N` blocks (the blocks will still be executed as a "warm-up").

Execution can also be configured. By using `--disable-paranoid-mode`, the Move VM will not use
runtime type checks, possible making execution faster.
Copy link

Choose a reason for hiding this comment

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

Typo: "possible" should be "possibly" in "possible making execution faster"

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in #15901


#### Example

Expand Down
9 changes: 9 additions & 0 deletions aptos-move/replay-benchmark/src/commands/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::{
};
use anyhow::{anyhow, bail};
use aptos_logger::Level;
use aptos_vm_environment::prod_configs::set_paranoid_type_checks;
use clap::Parser;
use std::path::PathBuf;
use tokio::fs;
Expand Down Expand Up @@ -61,6 +62,13 @@ pub struct BenchmarkCommand {
the overall time to execute all blocks"
)]
measure_overall_time: bool,

#[clap(
long,
default_value_t = false,
help = "If false, Move VM runs in paranoid mode, if true, paranoid mode is not used"
)]
disable_paranoid_mode: bool,
}

impl BenchmarkCommand {
Expand Down Expand Up @@ -109,6 +117,7 @@ impl BenchmarkCommand {
})
.collect::<Vec<_>>();

set_paranoid_type_checks(!self.disable_paranoid_mode);
BenchmarkRunner::new(
self.concurrency_levels,
self.num_repeats,
Expand Down
Loading