2.4-HTML 报告

HTML 基准测试报告

译文 · 基于 Criterion.rs Documentation

HTML 报告

原文链接: https://bheisler.github.io/criterion.rs/book/user_guide/html_report.html

从 Criterion.rs 0.4.0 起,必须通过 html_reports feature 显式启用 HTML 报告:

1
2
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }

Criterion.rs 可在 target/criterion/reports/index.html 生成展示基准测试结果的 HTML 报告。默认情况下,若可用则使用 gnuplot 生成图表,否则使用 plotters crate。以下示例由 gnuplot 后端生成,plotters 生成的图表类似。

要查看示例报告,点击此处。有关所显示图表与统计的更多细节,请参阅本书其他页面。

最后修改 August 23, 2026: 更新 (499855b16)