Bench Class For More Robust Speed Tests
authorLuc Trudeau <luc@trud.ca>
Tue, 22 May 2018 18:16:15 +0000 (14:16 -0400)
committerLuc Trudeau <luc@trud.ca>
Tue, 29 May 2018 13:04:47 +0000 (13:04 +0000)
commitb2898a9ade42f623cdc6ab526de657fd078660d9
treee12d7bd0456d1e70535093d8c486ba6e64d9683c
parent2b08f89076d1e93339fbbcc10e3298a0eec66bd6
Bench Class For More Robust Speed Tests

To make speed testing more robust, the AbstractBench runs the
desired code multiple times and report the median run time with
mean absolute deviation around the median.

To use the AbstractBench, simply add it as a parent to your test
class, and implement the run() method (with the code you want to
benchmark).

Sample output for VP9QuantizeTest

  [    BENCH ]      Bypass calculations       4x4  165.8 ms ( ±1.0 ms )
  [    BENCH ]        Full calculations       4x4  165.8 ms ( ±0.9 ms )
  [    BENCH ]      Bypass calculations       8x8  129.7 ms ( ±0.9 ms )
  [    BENCH ]        Full calculations       8x8  130.3 ms ( ±1.4 ms )
  [    BENCH ]      Bypass calculations     16x16  110.3 ms ( ±1.4 ms )
  [    BENCH ]        Full calculations     16x16  110.1 ms ( ±0.9 ms )

Change-Id: I1dd649754cb8c4c621eee2728198ea6a555f38b3
test/bench.cc [new file with mode: 0644]
test/bench.h [new file with mode: 0644]
test/test.mk
test/vp9_quantize_test.cc