Skip to content

Commit

Permalink
[benchmark] Make paranoid mode configurable for replay (#15900)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemitenkov authored Feb 10, 2025
1 parent 7dfddd6 commit 9fee3cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
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.

#### 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

0 comments on commit 9fee3cd

Please sign in to comment.