mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Further simplifications
This commit is contained in:
1 parent
1eafcf4739
commit
3558138cea
2 files changed
+35
-30
No files matched your search
@@ -15,6 +15,7 @@ use super::measurement::{Measurement, Measurements};
|
||||
|
||||
use anyhow::{bail, Context, Result};
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum BenchmarkIteration {
|
||||
NonBenchmarkRun,
|
||||
Warmup(u64),
|
||||
@@ -36,7 +37,7 @@ pub trait Executor {
|
||||
fn run_command_and_measure(
|
||||
&self,
|
||||
command: &Command<'_>,
|
||||
iteration: &BenchmarkIteration,
|
||||
iteration: BenchmarkIteration,
|
||||
command_failure_action: Option<CmdFailureAction>,
|
||||
output_policy: &CommandOutputPolicy,
|
||||
) -> Result<Measurement>;
|
||||
@@ -56,7 +57,7 @@ pub trait Executor {
|
||||
|
||||
fn run_command_and_measure_common(
|
||||
mut command: std::process::Command,
|
||||
iteration: &BenchmarkIteration,
|
||||
iteration: BenchmarkIteration,
|
||||
command_failure_action: CmdFailureAction,
|
||||
command_input_policy: &CommandInputPolicy,
|
||||
command_output_policy: &CommandOutputPolicy,
|
||||
@@ -132,7 +133,7 @@ impl Executor for RawExecutor<'_> {
|
||||
fn run_command_and_measure(
|
||||
&self,
|
||||
command: &Command<'_>,
|
||||
iteration: &BenchmarkIteration,
|
||||
iteration: BenchmarkIteration,
|
||||
command_failure_action: Option<CmdFailureAction>,
|
||||
output_policy: &CommandOutputPolicy,
|
||||
) -> Result<Measurement> {
|
||||
@@ -175,7 +176,7 @@ impl Executor for ShellExecutor<'_> {
|
||||
fn run_command_and_measure(
|
||||
&self,
|
||||
command: &Command<'_>,
|
||||
iteration: &BenchmarkIteration,
|
||||
iteration: BenchmarkIteration,
|
||||
command_failure_action: Option<CmdFailureAction>,
|
||||
output_policy: &CommandOutputPolicy,
|
||||
) -> Result<Measurement> {
|
||||
@@ -230,7 +231,7 @@ impl Executor for ShellExecutor<'_> {
|
||||
// Just run the shell without any command
|
||||
let res = self.run_command_and_measure(
|
||||
&Command::new(None, ""),
|
||||
&BenchmarkIteration::NonBenchmarkRun,
|
||||
BenchmarkIteration::NonBenchmarkRun,
|
||||
None,
|
||||
&CommandOutputPolicy::Null,
|
||||
);
|
||||
@@ -304,7 +305,7 @@ impl Executor for MockExecutor {
|
||||
fn run_command_and_measure(
|
||||
&self,
|
||||
command: &Command<'_>,
|
||||
_iteration: &BenchmarkIteration,
|
||||
_iteration: BenchmarkIteration,
|
||||
_command_failure_action: Option<CmdFailureAction>,
|
||||
_output_policy: &CommandOutputPolicy,
|
||||
) -> Result<Measurement> {
|
||||
|
||||
Reference in new issue
Block a user