[FR] Register function using macro, write the loop part only
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- cpp
- 领域
- performance
调研方向
首先检查现有的 BENCHMARK_F、BENCHMARK_DEFINE_F 和 BENCHMARK_CAPTURE 宏 API,以了解其注册和回调模式。确定所提议的更简单注册形式是否可行,同时不会失去对 benchmark::State 或 setup 和 teardown 方法的访问。完成的标准是:有一个达成一致的 API 设计,并为受支持的使用模式提供实现和覆盖。
由索引模型根据 Issue 内容生成。
描述
Hi. I was thinking about a way to register a test by writing as little as possible boilerplate and looking for something like:
BENCHMARK_SIMPLE(TestName) {
// Benchmark subject
}
The downside that you have to write second } to at least end the function.
And as with BENCHMARK_F, you can't call methods afterwards.
BENCHMARK_DEFINE_SIMPLE(TestName) {
// Benchmark subject
}
BENCHMARK_REGISTER_SIMPLE(TestName)->Setup(...)->Teardown(...);
Now we can call methods, but we have same thing as with BENCHMARK_DEFINE_F: you have to spell the name of the test twice. 100% no copypasta :smiling:
If we pass do as BENCHMARK_CAPTURE we will have an almost perfect solution.
BENCHMARK_SIMPLE_CAPTURE([](benchmark::State& state){
})->Setup(...)->Teardown(...);
But we still have state argument written out. Dang it. We could remove it, but then we won't be able to get/set data from/to state.
I'll leave it as it for now, what do you think? Is it useful and is possible?
- 主要语言
- C++
- 星标
- 10.5k
- 派生
- 1.8k
- 平均合并
- 2 天 2 小时
- 30 天内合并 PR
- 31
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/benchmark 的其他 Issue
-
[BUG] Segfault when all runs of a Complexity() benchmark are skipped可能已有人在做 @nitanshnagpal 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
[BUG] Confusing title in docs/platform_specific_build_instructions.md可能已有人在做 @skryabae 于 27 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
[BUG] Memory manager counts allocations not part of benchmark可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
google/benchmark#2149 · 5 条评论 ·
维护者通常 1 天内回复
-
Three small hardening notes from a security review: CSV formula-prefix neutralization, full C0 escaping in the JSON reporter, and type diagnostics in gbench/compare.py可能已有人在做 @Aryan9891 于 6 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 64/100
google/benchmark#2299 · 2 条评论 ·
维护者通常 1 天内回复
-
[FR] Add native Zig bindings via top-level `bindings/zig`可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 5/5 一周以上 新手友好度 42/100
google/benchmark#2266 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
-
Bug
难度 2/5 1-3 小时 新手友好度 68/100
SCIInstitute/SCIRun#2909 ·
维护者通常 2 天内回复
-
bug libcudf
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
Triage: Needed
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 2 天内回复