博客地址:http://home.cnblogs.com/u/zengjianrong/

google benchmark

最小用例:https://github.com/google/benchmark?tab=readme-ov-file#usage

排除干扰:https://github.com/google/benchmark/blob/main/docs/reducing_variance.md

1. benmark编译为release版本:-DCMAKE_BUILD_TYPE=Release

2. 禁止cpu频率调节:sudo cpupower frequency-set --governor performance

3. 禁止cpu超频:echo 0 | sudo tee /sys/devices/system/cpu/cpufreq/boost

4. 【可选】绑核:taskset -c 0 ./mybenchmark

 

 

查看参数

benchmark --help
benchmark [--benchmark_list_tests={true|false}]
[--benchmark_filter=<regex>]
[--benchmark_min_time=<min_time>]   比较常用,设置测试的时间长度
[--benchmark_repetitions=<num_repetitions>]  比较常用,可用于增加测试次数,以及计算方差等
[--benchmark_enable_random_interleaving={true|false}]
[--benchmark_report_aggregates_only={true|false}]
[--benchmark_display_aggregates_only={true|false}]
[--benchmark_format=<console|json|csv>]  输出格式,默认是console
[--benchmark_out=<filename>]
[--benchmark_out_format=<json|console|csv>]
[--benchmark_color={auto|true|false}]
[--benchmark_counters_tabular={true|false}]
[--benchmark_context=<key>=<value>,...]
[--benchmark_time_unit={ns|us|ms|s}]
[--v=<verbosity>]

 

posted @   black_man  阅读(71)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
点击右上角即可分享
微信分享提示