pub struct Cachegrind(/* private fields */);
default
only.Expand description
The configuration for cachegrind
Can be specified in crate::LibraryBenchmarkConfig::tool
or
crate::BinaryBenchmarkConfig::tool
.
§Example
use iai_callgrind::{LibraryBenchmarkConfig, main, Cachegrind};
main!(
config = LibraryBenchmarkConfig::default()
.tool(Cachegrind::default());
library_benchmark_groups = some_group
);
Implementations§
Source§impl Cachegrind
impl Cachegrind
Sourcepub fn with_args<I, T>(args: T) -> Self
pub fn with_args<I, T>(args: T) -> Self
Create a new Cachegrind
configuration with initial command-line arguments
See also Callgrind::args
and Cachegrind::args
§Examples
use iai_callgrind::Cachegrind;
let config = Cachegrind::with_args(["intr-at-start=no"]);
Sourcepub fn args<I, T>(&mut self, args: T) -> &mut Self
pub fn args<I, T>(&mut self, args: T) -> &mut Self
Add command-line arguments to the Cachegrind
configuration
Valid arguments are https://valgrind.org/docs/manual/cg-manual.html#cg-manual.cgopts and the core valgrind command-line arguments https://valgrind.org/docs/manual/manual-core.html#manual-core.options.
See also Callgrind::args
§Examples
use iai_callgrind::Cachegrind;
let config = Cachegrind::default().args(["intr-at-start=no"]);
Sourcepub fn enable(&mut self, value: bool) -> &mut Self
pub fn enable(&mut self, value: bool) -> &mut Self
Enable this tool. This is the default.
See also Callgrind::enable
§Examples
use iai_callgrind::Cachegrind;
let config = Cachegrind::default().enable(false);
Sourcepub fn format<I, T>(&mut self, cachegrind_metrics: T) -> &mut Self
pub fn format<I, T>(&mut self, cachegrind_metrics: T) -> &mut Self
Customize the format of the cachegrind output
See also Callgrind::format
for more details and crate::CachegrindMetrics
for valid
metrics.
§Examples
use iai_callgrind::{Cachegrind, CachegrindMetric, CachegrindMetrics};
let config =
Cachegrind::default().format([CachegrindMetric::Ir.into(), CachegrindMetrics::CacheSim]);
Sourcepub fn limits<T>(&mut self, limits: T) -> &mut Self
pub fn limits<T>(&mut self, limits: T) -> &mut Self
Configure the limits percentages over/below which a performance regression can be assumed
See also Callgrind::limits
.
§Examples
use iai_callgrind::{Cachegrind, CachegrindMetric};
let config = Cachegrind::default().limits([(CachegrindMetric::Ir, 5f64)]);
Sourcepub fn fail_fast(&mut self, value: bool) -> &mut Self
pub fn fail_fast(&mut self, value: bool) -> &mut Self
If set to true, then the benchmarks fail on the first encountered regression
The default is false
and the whole benchmark run fails with a regression error after all
benchmarks have been run.
§Examples
use iai_callgrind::Cachegrind;
let config = Cachegrind::default().fail_fast(true);
Trait Implementations§
Source§impl AsRef<Tool> for Cachegrind
impl AsRef<Tool> for Cachegrind
Source§fn as_ref(&self) -> &InternalTool
fn as_ref(&self) -> &InternalTool
Source§impl Clone for Cachegrind
impl Clone for Cachegrind
Source§fn clone(&self) -> Cachegrind
fn clone(&self) -> Cachegrind
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more