Name Date Size #Lines LOC

..--

media/H25-Apr-2025-131,073131,072

third_party/perf/H25-Apr-2025-1,124945

ANGLEPerfTest.cppH A D25-Apr-202542.7 KiB1,4241,177

ANGLEPerfTest.hH A D25-Apr-20258.8 KiB317231

ANGLEPerfTestArgs.cppH A D25-Apr-20257.1 KiB184147

ANGLEPerfTestArgs.hH A D25-Apr-20251.5 KiB5942

AstcDecompressorPerf.cppH A D25-Apr-20252.7 KiB9466

BindingPerf.cppH A D25-Apr-20257.6 KiB261206

BitSetIteratorPerf.cppH A D25-Apr-20251.7 KiB7751

BlitFramebufferPerf.cppH A D25-Apr-20258.1 KiB272223

BufferSubData.cppH A D25-Apr-202510.3 KiB395320

ClearPerf.cppH A D25-Apr-20255.4 KiB242181

CompilerPerf.cppH A D25-Apr-20259.8 KiB349281

DispatchComputePerf.cppH A D25-Apr-20255.2 KiB177138

DrawCallPerf.cppH A D25-Apr-202520.2 KiB669521

DrawCallPerfParams.cppH A D25-Apr-2025856 4123

DrawCallPerfParams.hH A D25-Apr-20252.6 KiB12496

DrawElementsPerf.cppH A D25-Apr-20256.7 KiB244185

DynamicPromotionPerfTest.cppH A D25-Apr-20255.3 KiB180128

EGLInitializePerf.cppH A D25-Apr-20255.4 KiB166127

EGLMakeCurrentPerf.cppH A D25-Apr-20255 KiB163128

FramebufferAttachmentPerfTest.cppH A D25-Apr-20256.9 KiB235182

GenerateMipmapPerf.cppH A D25-Apr-20259.9 KiB372270

ImagelessFramebufferPerfTest.cppH A D25-Apr-20254.4 KiB154115

IndexConversionPerf.cppH A D25-Apr-20256 KiB226162

IndexDataManagerTest.cppH A D25-Apr-20256.6 KiB201155

InstancingPerf.cppH A D25-Apr-202510.5 KiB358274

InterleavedAttributeData.cppH A D25-Apr-20257.6 KiB242179

LinkProgramPerfTest.cppH A D25-Apr-20256.9 KiB238186

MapBufferRange.cppH A D25-Apr-202514.3 KiB505419

MultisampleResolvePerf.cppH A D25-Apr-202510.1 KiB313239

MultisampledRenderToTexturePerf.cppH A D25-Apr-20258.3 KiB289218

MultisampledSwapchainResolve.cppH A D25-Apr-20253.2 KiB13894

MultiviewPerf.cppH A D25-Apr-202521.9 KiB611504

ParallelLinkProgramPerfTest.cppH A D25-Apr-202510.8 KiB358277

PointSprites.cppH A D25-Apr-20255.8 KiB237168

PreRotationPerf.cppH A D25-Apr-20255.2 KiB213156

ProgramPipelineObjectPerfTest.cppH A D25-Apr-20255.2 KiB187137

README.mdH A D25-Apr-20258.5 KiB132103

RGBImageAllocation.cppH A D25-Apr-20255.2 KiB182138

ResultPerf.cppH A D25-Apr-20251.5 KiB7254

TextureSampling.cppH A D25-Apr-202510.3 KiB356273

TextureUploadPerf.cppH A D25-Apr-202516.9 KiB590459

TexturesPerf.cppH A D25-Apr-202512.3 KiB396319

TracePerfTest.cppH A D25-Apr-202597.7 KiB2,9462,455

UniformsPerf.cppH A D25-Apr-202516.5 KiB537444

VertexArrayPerfTest.cppH A D25-Apr-20256.2 KiB232185

VulkanBarriersPerf.cppH A D25-Apr-202513.3 KiB412251

VulkanCommandBufferPerf.cppH A D25-Apr-202525.8 KiB638511

VulkanPipelineCachePerf.cppH A D25-Apr-20254.3 KiB153113

glmark2Benchmark.cppH A D25-Apr-202510.4 KiB310217

README.md

1# ANGLE Performance Tests
2
3`angle_perftests` is a standalone microbenchmark testing suite that contains
4tests for the OpenGL API. `angle_trace_tests` is a suite to run captures traces for correctness and
5performance. Because the traces contain confidential data, they are not publicly available.
6For more details on ANGLE's tracer please see the [docs](../restricted_traces/README.md).
7
8The tests currently run on the Chromium ANGLE infrastructure and report
9results to the [Chromium perf dashboard](https://chromeperf.appspot.com/report).
10 Please refer to the[public dashboard docs][DashboardDocs] for help
11
12[DashboardDocs]: https://chromium.googlesource.com/catapult/+/HEAD/dashboard/README.md
13
14## Running the Tests
15
16You can follow the usual instructions to [check out and build ANGLE](../../../doc/DevSetup.md).
17 Build the `angle_perftests` or `angle_trace_tests` targets. Note that all
18test scores are higher-is-better. You should also ensure `is_debug=false` in
19your build. Running with `angle_assert_always_on` or debug validation enabled
20is not recommended.
21
22Variance can be a problem when benchmarking. We have a test harness to run a
23tests repeatedly to find a lower variance measurement. See `src/tests/run_perf_tests.py`.
24
25To use the script first build `angle_perftests` or `angle_trace_tests`, set
26your working directory your build directory, and invoke the
27`run_perf_tests.py` script. Use `--test-suite` to specify your test suite,
28and `--filter` to specify a test filter.
29
30### Choosing the Test to Run
31
32You can choose individual tests to run with `--gtest_filter=*TestName*`. To
33select a particular ANGLE back-end, add the name of the back-end to the test
34filter. For example: `DrawCallPerfBenchmark.Run/gl` or
35`DrawCallPerfBenchmark.Run/d3d11`. Many tests have sub-tests that run
36slightly different code paths. You might need to experiment to find the right
37sub-test and its name.
38
39### Null/No-op Configurations
40
41ANGLE implements a no-op driver for OpenGL, D3D11 and Vulkan. To run on these
42configurations use the `gl_null`, `d3d11_null` or `vulkan_null` test
43configurations. These null drivers will not do any GPU work. They will skip
44the driver entirely. These null configs are useful for diagnosing performance
45overhead in ANGLE code.
46
47### Command-line Arguments
48
49Each test runs N trials and prints metrics for each trial. Trials are limited by time (default), step/frame limits can also be set. Note that at the beginning performance might be affected by hitting new code paths, cold caches etc (see warmup below) but longer runs on some devices trigger thermal throttling affecting performance (known: phones, desktop perf CI bots).
50
51Several command-line arguments control how the tests run:
52
53* `--run-to-key-frame`: If the trace specifies a key frame, run to that frame and stop. Traces without a `KeyFrames` entry in their JSON will default to frame 1. This is primarily to save cycles on our bots that do screenshot quality comparison.
54* `--enable-trace`: Write a JSON event log that can be loaded in Chrome.
55* `--trace-file file`: Name of the JSON event log for `--enable-trace`.
56* `--steps-per-trial x`: Fixed number of steps to run for each test trial.
57* `--max-steps-performed x`: Upper maximum on total number of steps for the entire test run.  For a quick smoke test, you can specify 1.
58* `--render-test-output-dir=dir`: Directory to store test artifacts (including screenshots but unlike `--screenshot-dir`, `dir` here is always a local directory regardless of platform and `--save-screenshots` isn't implied).
59* `--verbose`: Print extra timing information.
60* `--trial-time x` or `--max-trial-time x`: Run each test trial under this max time. Defaults to 10 seconds.
61* `--fixed-test-time x`: Run the tests until this much time has elapsed.
62* `--warmup`: Run a warmup phase before the test. Defaults to off.
63* `--fixed-test-time-with-warmup x`: Start with a warmup, then run the tests until this much time has elapsed.
64* `--trials`: Number of times to repeat testing. Defaults to 3.
65* `--no-finish`: Don't call glFinish after each test trial.
66* `--validation`: Enable serialization validation in the trace tests. Normally used with SwiftShader and retracing.
67* `--perf-counters`: Additional performance counters to include in the result output. Separate multiple entries with colons: ':'.
68
69The command line arguments implementations are located in [`ANGLEPerfTestArgs.cpp`](ANGLEPerfTestArgs.cpp).
70
71## Test Breakdown
72
73### Microbenchmarks
74
75* [`DrawCallPerfBenchmark`](DrawCallPerf.cpp): Runs a tight loop around DrawArarys calls.
76  * `validation_only`: Skips all rendering.
77  * `render_to_texture`: Render to a user Framebuffer instead of the default FBO.
78  * `vbo_change`: Applies a Vertex Array change between each draw.
79  * `tex_change`: Applies a Texture change between each draw.
80* [`UniformsBenchmark`](UniformsPerf.cpp): Tests performance of updating various uniforms counts followed by a DrawArrays call.
81    * `vec4`: Tests `vec4` Uniforms.
82    * `matrix`: Tests using Matrix uniforms instead of `vec4`.
83    * `multiprogram`: Tests switching Programs between updates and draws.
84    * `repeating`: Skip the update of uniforms before each draw call.
85* [`DrawElementsPerfBenchmark`](DrawElementsPerf.cpp): Similar to `DrawCallPerfBenchmark` but for indexed DrawElements calls.
86* [`BindingsBenchmark`](BindingPerf.cpp): Tests Buffer binding performance. Does no draw call operations.
87    * `100_objects_allocated_every_iteration`: Tests repeated glBindBuffer with new buffers allocated each iteration.
88    * `100_objects_allocated_at_initialization`: Tests repeated glBindBuffer the same objects each iteration.
89* [`TexSubImageBenchmark`](TexSubImage.cpp): Tests `glTexSubImage` update performance.
90* [`BufferSubDataBenchmark`](BufferSubData.cpp): Tests `glBufferSubData` update performance.
91* [`TextureSamplingBenchmark`](TextureSampling.cpp): Tests Texture sampling performance.
92* [`TextureBenchmark`](TexturesPerf.cpp): Tests Texture state change performance.
93* [`LinkProgramBenchmark`](LinkProgramPerfTest.cpp): Tests performance of `glLinkProgram`.
94* [`glmark2`](glmark2.cpp): Runs the glmark2 benchmark.
95
96Many other tests can be found that have documentation in their classes.
97
98### Trace Tests
99
100* [`TracePerfTest`](TracePerfTest.cpp): Runs replays of restricted traces, not
101  available publicly. To enable, read more in [`RestrictedTraceTests`](../restricted_traces/README.md)
102
103Trace tests take command line arguments that pick the run configuration:
104
105* `--use-gl=native`: Runs the tests against the default system GLES implementation instad of your local ANGLE.
106* `--use-angle=backend`: Picks an ANGLE back-end. e.g. vulkan, d3d11, d3d9, gl, gles, metal, or swiftshader. Vulkan is the default.
107* `--offscreen`: Run with an offscreen surface instead of swapping every frame.
108* `--vsync`: Run with vsync enabled, and measure CPU and GPU work insead of wall clock time.
109* `--minimize-gpu-work`: Modify API calls so that GPU work is reduced to minimum.
110* `--screenshot-dir dir`: Directory to store test screenshots. Implies `--save-screenshots`. On Android this directory is on device, not local (see also `--render-test-output-dir`). Only implemented in `TracePerfTest`.
111* `--save-screenshots`: Save screenshots. Only implemented in `TracePerfTest`.
112* `--screenshot-frame <frame>`: Which frame to capture a screenshot of. Defaults to first frame (1). Using `-1` will capture every frame rendered, including those after Reset for multiple loops. Only implemented in `TracePerfTest`.
113* `--include-inactive-resources` : Include all resources captured at trace-time during replay. Only resources which are active during trace execution are replayed by default.
114
115For example, for an endless run with no warmup on swiftshader, run:
116
117`angle_trace_tests --gtest_filter=TraceTest.trex_200 --use-angle=swiftshader --trial-time 1000000`
118
119## Understanding the Metrics
120
121* `cpu_time`: Amount of CPU time consumed by an iteration of the test. This is backed by
122`GetProcessTimes` on Windows, `getrusage` on Linux/Android, and `zx_object_get_info` on Fuchsia.
123  * This value may sometimes be larger than `wall_time`. That is because we are summing up the time
124on all CPU threads for the test.
125* `wall_time`: Wall time taken to run a single iteration, calculated by dividing the total wall
126clock time by the number of test iterations.
127  * For trace tests, each rendered frame is an iteration.
128* `gpu_time`: Estimated GPU elapsed time per test iteration. We compute the estimate using GLES
129[timestamp queries](https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_disjoint_timer_query.txt)
130at the beginning and ending of each test loop.
131  * For trace tests, this metric is only enabled in `vsync` mode.
132