From 519b16c4b026e177a94bfa10f02bce66742f599e Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 17 Sep 2019 21:02:38 +0000 Subject: [PATCH] Add README.md for the Dawn perf test harness Bug: dawn:208 Change-Id: Ic9b4c83ab3c27851d149adb5986f3a5556d0548a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11283 Commit-Queue: Austin Eng Reviewed-by: Kai Ninomiya --- src/tests/perf_tests/DawnPerfTest.h | 13 ------------- src/tests/perf_tests/README.md | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 src/tests/perf_tests/README.md diff --git a/src/tests/perf_tests/DawnPerfTest.h b/src/tests/perf_tests/DawnPerfTest.h index 0164ea906a..b858a8781d 100644 --- a/src/tests/perf_tests/DawnPerfTest.h +++ b/src/tests/perf_tests/DawnPerfTest.h @@ -41,19 +41,6 @@ class DawnPerfTestEnvironment : public DawnTestEnvironment { unsigned int mOverrideStepsToRun = 0; }; -// Dawn Perf Tests calls Step() of a derived class to measure its execution -// time. First, a calibration step is run which determines the number of times -// to call Step() to last approximately |kCalibrationRunTimeSeconds|. Then, -// Step() is called for the computed number of times, or until -// |kMaximumRunTimeSeconds| is exceeded. |kNumTrials| are performed and the -// results and averages per iteration** are printed. -// -// The results are printed according to the format specified at -// [chromium]//build/scripts/slave/performance_log_processor.py -// -// ** The number of iterations a test performs should be passed to the -// constructor of DawnPerfTestBase. The reported times are the total time -// divided by (numSteps * iterationsPerStep). class DawnPerfTestBase { static constexpr double kCalibrationRunTimeSeconds = 1.0; static constexpr double kMaximumRunTimeSeconds = 10.0; diff --git a/src/tests/perf_tests/README.md b/src/tests/perf_tests/README.md new file mode 100644 index 0000000000..5dedb4c0f8 --- /dev/null +++ b/src/tests/perf_tests/README.md @@ -0,0 +1,24 @@ +# Dawn Perf Tests + +## Tests + +**BufferUploadPerf** + +Tests repetitively uploading data to the GPU using either `SetSubData` or `CreateBufferMapped`. + +## Test Harness +The test harness provides a `DawnPerfTestBase` which Derived tests should inherit from. +The harness calls `Step()` of a Derived class to measure its execution +time. First, a calibration step is run which determines the number of times +to call `Step()` to last approximately `kCalibrationRunTimeSeconds`. Then, +`Step()` is called for the computed number of times, or until +`kMaximumRunTimeSeconds` is exceeded. `kNumTrials` are performed and the +results and averages per iteration\* are printed. +(See `DawnPerfTest.h` for the values of the constants). + +The results are printed according to the format specified at +[[chromium]//build/scripts/slave/performance_log_processor.py](https://cs.chromium.org/chromium/build/scripts/slave/performance_log_processor.py) + +\*The number of iterations a test performs should be passed to the +constructor of `DawnPerfTestBase`. The reported times are the total time +divided by `numSteps * iterationsPerStep`.