When is criterion stable between runs, how can it be made more so?

未关闭
#115 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
haskell
领域
performance

调研方向

首先,使用相同的简单 microbenchmark、重复的长时间 -L20 运行,以及单独的高 --iters 运行,复现报告中的变化。比较测量结果和回归数据,尤其关注 X 轴点的选择以及 R^2 较低的情况。完成的标准是确定连续运行为何会出现超过 10% 的差异,并定义一种经过验证的稳定性改进方法,其中包括任何相关的机器状态控制,例如 Krun 的冷却步骤。

由索引模型根据 Issue 内容生成。

描述

Question

Criterion gives highly precise measurements. Given two measurements of a simple microbenchmark A, A1,A2, if:

  • both were taking starting from a similar machine state,
  • both report very high R^2 values, and
  • both were run for a long -L20 or higher,

then A1/A2 should be close estimates, right? No, unfortunately.

When measuring 1279 benchmarks on Stackage, we have found that it's very common to have greater than 10% variation between consecutive runs of the same, small, deterministic benchmark.

Anecdotally, we seem to get more stable numbers from individual high --iters runs, than from linear regression. I don't have a good explanation yet. Perhaps the non-determinism in the selection of data points (on the X axis) is having more of an effect than we expected? Certainly, when there is a bad R^2, we've seen exactly where it starts running has a big effect.

@RyanGlScott and @vollmerm have been working on this.

(On a related note, it would be great to have some assistance when using criterion with the kinds of things Krun controls, like waiting for the machine to cool down to a baseline temperature before starting a run.)

主要语言
Haskell
星标
525
派生
88
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

haskell/criterion 的其他 Issue

查看 haskell/criterion 的全部 Issue

相似的 Issue

更多 Haskell Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。