[FR] Report max, min, avg time per iteration

オープン
#1,660 コメント 14 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@izo-ef がすでに取り組んでいます。

2024年12月22日 から。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
領域
performance

調査の方向性

issue ではソースファイルもテストも指定されていません。まず google/benchmark の既存のメトリクス報告とイテレーションごとの時間計測の経路をたどり、そのうえで、CPU とイテレーション数に加えて、イテレーション時間の平均、最小、最大をフラグで公開する方法を判断します。完了の条件は、要求されたメトリクスがイテレーションレベルの外れ値について正しく報告され、テストでカバーされていることです。

索引モデルが issue の本文から書いたものです。

説明

Is your feature request related to a problem? Please describe.
Currently there is no way to report max, min time per iteration. Once the benchmark is run you will get these metrics: "Time" , "CPU" , "Iterations".

In many scenarios you would love to know min and max beyond the average time to spot the outliers. Imaging that you decode video frames. You might want to know if there are video frames which took exceptionally longer than the other frames in your video.

While it's possible to set the number of repetitions > 1 and implement custom statistics to obtain min and max, there is no similar logic per iterations basis.

Describe the solution you'd like
Add some flag to report the metrics in this way:
"Average iteration time", "Minimum iteration time", "Maximum iteration time", "average iteration CPU" , "Iterations".

Describe alternatives you've considered
I've tried to repetitions > 1 and implemented custom statistics. However, it did not solve my problem. I would love to have max and min per iteration and not per repetition. I also tried the combination of manual timing and counters to imitate max and min, however that solution is not elegant.

Additional context
At the end, I ended up using a DYI benchmark and would love to add min/max per iteration to google/benchmark.

主要言語
C++
スター
10.5k
フォーク
1.8k
平均マージ
1日 17時間
マージ済み PR(30日)
30

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google/benchmark のほかの issue

google/benchmark の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。