[FR] Allow complexity to fit a constant offset
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- cpp
- 领域
- performance
调研方向
Complexity fitters are implemented in src/complexity.cc (ComputeBigO) and exposed through the BigO enum in include/benchmark/benchmark.h; the BigO and RMS output columns are emitted by the reporters in src/reporter.cc and src/json_reporter.cc. Start by reading src/complexity.cc alongside test/complexity_test.cc to see how oN/oNLogN fits are computed and tested. Done means a new offset-aware fitter selectable from the benchmark registration, an extra output line for the constant term, and passing complexity tests.
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
For some (cryptographic) algorithms that I'm benchmarking, the real complexity is something like O(a*N + C) where there is a fixed minimum running time that is non-trivial. Using the builtin oN complexity function always has a high RMS even though the actual times are quite linear (with an offset).
Describe the solution you'd like
Provide a different complexity fitter that will include a constant offset, with identical behavior to current complexity functions (no change to existing behaviors). When used with the new complexity function, a new Run output line would be included for the constant offset.
Describe alternatives you've considered
I can refactor all of my own functions to attempt to estimate the N=0 offset value.
But that will not be the same as a proper linear regression with offset, which has a closed form solution.
Additional context
An example of the output for one of the heavy-weight algorithms (ML-DSA-87) for varying plaintext sizes, which has a strong offset of ~700 us. Without fitting the offset, the RMS is very high.
BM_SigSign/MLDSA87/1024 709327 ns 654350 ns 4307
BM_SigSign/MLDSA87/4096 730189 ns 673641 ns 4299
BM_SigSign/MLDSA87/32768 800954 ns 738861 ns 3778
BM_SigSign/MLDSA87/262144 1197191 ns 1104392 ns 2440
BM_SigSign/MLDSA87/1048576 2587894 ns 2385932 ns 1185
BM_SigSign/MLDSA87_BigO 2.61 N 2.41 N
BM_SigSign/MLDSA87_RMS 50 % 50 %
- 主要语言
- C++
- 星标
- 10.5k
- 派生
- 1.8k
- 平均合并
- 2 天 1 小时
- 30 天内合并 PR
- 28
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/benchmark 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
[BUG] Memory manager counts allocations not part of benchmark可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
google/benchmark#2149 · 7 条评论 ·
维护者通常 1 天内回复
-
[FR] New "benchstat" output format可能已有人在做 @DenysZm 于 4 天前认领。 未关闭
google/benchmark#2397 · 4 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[FR] Add native Zig bindings via top-level `bindings/zig`可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 5/5 一周以上 新手友好度 42/100
google/benchmark#2266 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
google/benchmark#2235 · 2 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
component: tabs platform: macOS
难度 2/5 1-3 小时 新手友好度 72/100
zen-browser/desktop#16860 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
metasequoiaime/msime#12003 ·
维护者通常 1 天内回复