C++备忘录068:Grouping google benchmark result

CppCon 2015 - Chandler Carruth ‘Tuning C++ - Benchmarks, and CPUs, and Compilers! Oh My!’

听Chandler这个讲座的时候,google benchmark的输出看得我眼快瞎了

bench_fastmod/16/32             176 ns          171 ns      3972393
bench_fastmod/16/128            192 ns          190 ns      3620738
bench_fastmod/16/224            195 ns          192 ns      3614277
bench_fastmod/64/32             484 ns          478 ns      1626646
bench_fastmod/64/128            456 ns          449 ns      1376393
bench_fastmod/64/224            490 ns          483 ns      1431184
...

于是写了一段脏代码

$ ./a.out --benchmark_format=json | ./cmp_gbm.py 
16/32
    bench_fastmod           153.89ns    100.00%
    bench_fastmod16         139.52ns     90.66%
    bench_fastmod4          153.68ns     99.86%
    bench_mod               198.32ns    128.87%
16/128
    bench_fastmod           148.41ns    100.00%
    bench_fastmod16         139.52ns     94.01%
    bench_fastmod4          142.18ns     95.80%
    bench_mod               186.52ns    125.68%
...

应该有现成的脚本实现,我没找到

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值