Skip to main content

BenchArgs

Struct BenchArgs 

Source
pub struct BenchArgs {
    pub inputs: Vec<String>,
    pub formats: Vec<String>,
    pub levels: bool,
    pub per_file: bool,
    pub threads: Option<usize>,
    pub memory_limit: Option<String>,
    pub repeat: u32,
    pub json: bool,
    pub csv: bool,
    pub table_only: bool,
}
Expand description

The arguments of stuffr bench.

Fields§

§inputs: Vec<String>

Files to benchmark, or quoted glob patterns ('logs/*.log').

A path that exists is used as is; one that does not and contains *, ? or [ is expanded, its matches sorted. A directory is refused: name its files instead. So is a pipe or device: bench needs each file’s size, so write a pipe to a file first. A file it cannot open, a dangling symlink or an unreadable directory on the way is refused too, naming the path.

§formats: Vec<String>

Only these formats, comma-separated or repeated. Default: every codec this build can write with its real encoder.

§levels: bool

Run every level of each format instead of its default level only.

§per_file: bool

Compress each file as its own stream instead of all of them as one.

§threads: Option<usize>

Compress with N worker threads. 0 means auto-detect.

Threads apply to compression only: decompression is always timed single-threaded. OMITTING this flag is not the same as passing 0: without it, stuffr compresses single-threaded, so the same input always produces the same bytes on any machine. Multi-threaded xz and zstd split the input per worker, so their output depends on the worker count. bench ignores STUFFR_THREADS: threads come only from this flag.

§memory_limit: Option<String>

Cap the memory stuffr will ask for, e.g. 512M or 2G.

Input over half of it is streamed from disk rather than held in memory. Each codec gets the output destination its own worst case allows: a codec whose worst-case output is too large for the rest writes to a temp file, whose writes then count in its compress time, and its row is marked (*; output: disk). Defaults to 25% of available RAM, honouring cgroup limits.

§repeat: u32

Time each row N times and report the medians.

§json: bool

Emit one machine-readable JSON object instead of the table.

§csv: bool

Emit CSV, one line per row, instead of the table.

§table_only: bool

Print the table alone: no input line, no winners, no progress.

Trait Implementations§

Source§

impl Args for BenchArgs

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Debug for BenchArgs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for BenchArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.