docs

您正在閱讀 v0.1.0 的文件。Nabi 0.1.0 已停止支援。 最新版本:v0.1.3 →

core::bench

本頁內容

API 參考只有英文版,由標準函式庫原始碼中的英文文件註解產生。

the engine nabi bench drives.

A #[bench] fn takes a Bench and calls iter on the code to measure; work set up outside iter is not timed. iter calibrates the call count, warms up, samples, and reports median (+/- MAD) with Tukey outlier detection and GC-aware sample classification. Statistics and formatting live here; the runner only orchestrates the processes.

Structs

BenchSource

pub struct Bench

A benchmark's measuring handle: the generated harness passes one to each #[bench] fn, which calls iter with the code to time.

  • pub fn set_bytes(ref self, n: i64)§

    Source

    Report throughput: n bytes processed per call.

  • pub fn set_items(ref self, n: i64)§

    Source

    Report throughput: n items processed per call.

  • pub fn iter<T>(ref self, f: fn() -> T)§

    Source

    Measure f. Calibrate (unless fixed), warm up, sample, report.

Trait implementations 1