src/tests/perf_tests/CompilerPerf.cpp


Log

Author Commit Date CI Message
Kimmo Kinnunen 93b659f9 2025-07-04T12:35:29 Remove PoolAllocator push/pop feature PoolAllocator would manage a stack of memory pools upon client calling push() and pop(). This made the code unnecessarily complicated. The feature was only used with nesting of one, to mark the memory unused after a shader compile. Fix by removing the push/pop feature. Instantiate PoolAllocator in places the previous push() was and uninstantiating instead of previous pop(). This removes the feature where the PoolAllocator would hold on to the allocated memory in order to reuse it. This is seen as a progression: the allocator is held by the compiler, the compiler is held by the shader and each shader typically see only one compile. Thus the free pages were just leaking unused until the shader was destroyed. Instead, destructing the PoolAllocator instead of pop() will donate the memory back to platform/OS, where it is likely more useful. To preserve existing Vulkan behavior, add PoolAllocator::reset() which would mark the memory unused but leave them reserved for the PoolAllocator. Removes UB where PageHeader::nextPage would be accessed after ~PageHeader. Bug: angleproject:429513168 Change-Id: I21e58b46e0887380db3a2cab5ce22f0042cfae9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6701153 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Rafael Cintron d1a4b0ff 2019-05-04T17:15:42 Remove Feature Level 9_3 code Feature Level 9_3 was originally added for developers creating apps for devices which did not have the DirectX 9 API and are no longer supported. Hence, we can remove the corresponding code in the 11 backend. Bug: angleproject:355462523 Change-Id: I22db15640b435c61db4d82a815edbc65cecc4e12 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5824661 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Shahbaz Youssefi 02e7f967 2023-05-25T14:54:49 Translator: Remove the "variables" option Variable collection is invariably enabled by the front-end as well as other major users of ANGLE such as Firefox. All translator backends except GLSL force-enable variable collection either way. This change removes this compile option and enables variable collection unconditionally. The flag itself remains in ShCompileOptions until references to it are removed from Chromium. Bug: chromium:1447314 Change-Id: I4d3b30c1bfbd345c5ad269abc62c0a6a59de2f56 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4568524 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 6f80f0f0 2022-08-06T02:29:19 Translator: Clean up the compile flag passing interface Historically, compile flags were sent to the translator as a bitmask. Recently, we were getting close to running out of bits. Additionally, direct-to-metal work had started to introduce constants to be passed to the translator, which were misplaced in ShBuiltInResources and Caps. Recent work on Pixel Local Storage adds even more constants, aggravating the situation. In this change, the interface to passing compile flags is reworked. A struct is passed (instead of a bitmask) that has one bit for each flag. This can be indefinitely extended. Additionally, the constants needed by metal and PLS are also placed in this struct. In turn, the backends can set these options directly, and don't have to hack them into Caps to further get hacked into ShBuiltInResources. Bug: angleproject:7559 Change-Id: If93f1e1b8818ad3a0ac708ab04ab93b4b397d114 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812562 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 44bef8ae 2021-10-08T15:01:37 Remove traces of Feature Level 9_3 support from tests. Bug: angleproject:1284 Bug: angleproject:3042 Change-Id: Ic2f77d315e98c3b15c5fc8b0359168bce00867d4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3213294 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Brian Sheedy 2f4a7518 2019-08-16T14:09:13 Refactor perf tests to fix metric/story swapping Refactors the perf tests to fix the issue of metric and story being swapped, which causes issues when trying to convert to histograms. Specifically, does the following: 1. Rolls the version of src/tests/perf_tests/third_party/perf/ to Chromium 476dae823269c8d05b544271af97ad1adb0db8ee 2. Switch to using PerfResultReporter instead of PrintResult directly. 3. Split RenderTestParams::suffix into backend and story; backend is used as part of the metric, while story is used as the story. 4. Remove the "average" metric that was being automatically reported by ANGLEPerfTest, as reported results are automatically averaged. 5. Update the reported metric to more clearly distinguish between test, backend, and metric. It is now name_backend.metric. e.g. DrawCallPerf_vulkan.wall_time. Bug: chromium:923564,chromium:924618 Change-Id: I00cc191407052f23df57dbfa53b6fb088fc26960 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1762360 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Tobin Ehlis 5546fb4f 2019-01-17T12:25:54 Vulkan:Adding custom pool allocator Migrated pool allocator used by compiler to common. Planning to use this for ANGLE custom command buffers so this some refactoring in preparation for that work. Added a unit test to check PoolAllocator functionality. Bug: angleproject:2951 Reviewed-on: https://chromium-review.googlesource.com/c/1476953 Reviewed-by: Jamie Madill <jmadill@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com> Change-Id: I0b4f3d55ea1799e35c9799c221f7129233f30b24 Reviewed-on: https://chromium-review.googlesource.com/c/1492972
Yuly Novikov 0546b538 2019-02-25T22:47:17 Revert "Vulkan:Adding custom pool allocator" This reverts commit 941717496141b96f1d5817f31c2bb4a4e19847b9. Reason for revert: crashes on Debug bots Original change's description: > Vulkan:Adding custom pool allocator > > Migrated pool allocator used by compiler to common. > > Planning to use this for ANGLE custom command buffers so this some > refactoring in preparation for that work. > > Added a unit test to check PoolAllocator functionality. > > Bug: angleproject:2951 > Change-Id: I29618cfdb065b8a5fefd40719a35d27b1f6e99ef > Reviewed-on: https://chromium-review.googlesource.com/c/1476953 > Reviewed-by: Jamie Madill <jmadill@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Tobin Ehlis <tobine@google.com> TBR=ynovikov@chromium.org,jmadill@google.com,tobine@google.com,syoussefi@chromium.org Change-Id: Id8c522bd1d94154e871211d975e801a55cc9c257 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2951, angleproject:3169 Reviewed-on: https://chromium-review.googlesource.com/c/1487977 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Tobin Ehlis 94171749 2019-01-17T12:25:54 Vulkan:Adding custom pool allocator Migrated pool allocator used by compiler to common. Planning to use this for ANGLE custom command buffers so this some refactoring in preparation for that work. Added a unit test to check PoolAllocator functionality. Bug: angleproject:2951 Change-Id: I29618cfdb065b8a5fefd40719a35d27b1f6e99ef Reviewed-on: https://chromium-review.googlesource.com/c/1476953 Reviewed-by: Jamie Madill <jmadill@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
Tobin Ehlis 47ca1b2f 2019-01-23T16:11:41 Revert "Vulkan: Adding custom pool allocator" This reverts commit 05459e06fde5047ae8f5f90fe091c3255e6bc88e. Reason for revert: Clusterfuzz bugs flagged this commit Original change's description: > Vulkan: Adding custom pool allocator > > Copied pool allocator used by compiler to common and hooking it up as > custom allocator for CommandPools. Modified it to support reallocation. > > RendererVk now has a private poolAllocator and VkAllocationCallbacks > struct. The allocation callbacks are initialized to static functions > in RendererVk::initializeDevice() and then passed to CommandPool init() > and destroy() functions. > > Using the pool allocator saves Command Pool/Buffer clean-up time which > was showing us as a bottleneck is some cases. > > Bug: angleproject:2951 > Change-Id: I81aa8a7ec60397676fa722d6435029db27947ef4 > Reviewed-on: https://chromium-review.googlesource.com/c/1409867 > Commit-Queue: Tobin Ehlis <tobine@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=jmadill@chromium.org,tobine@google.com,ianelliott@google.com,syoussefi@chromium.org Change-Id: I363a351667c4dddef79833061790da90de477e70 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2951 Reviewed-on: https://chromium-review.googlesource.com/c/1430679 Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Tobin Ehlis 05459e06 2019-01-17T12:25:54 Vulkan: Adding custom pool allocator Copied pool allocator used by compiler to common and hooking it up as custom allocator for CommandPools. Modified it to support reallocation. RendererVk now has a private poolAllocator and VkAllocationCallbacks struct. The allocation callbacks are initialized to static functions in RendererVk::initializeDevice() and then passed to CommandPool init() and destroy() functions. Using the pool allocator saves Command Pool/Buffer clean-up time which was showing us as a bottleneck is some cases. Bug: angleproject:2951 Change-Id: I81aa8a7ec60397676fa722d6435029db27947ef4 Reviewed-on: https://chromium-review.googlesource.com/c/1409867 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 720ca449 2018-12-17T14:04:10 Pass GN header visibility check. This fixes a few things: * removes includes that weren't supposed to be present * scopes some compiler code into white_box_perftests * makes version.h/commit and angle_common id more visible * roll zlib to a version that passes check This should help prevent build problems from popping up in the downstream Chromium build. We could also potentially look at including gn check in our CQ recipe. Bug: chromium:915429 Change-Id: I350f543e16de13c84eb2c43260f4966d47185114 Reviewed-on: https://chromium-review.googlesource.com/c/1380771 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill f3acb8c1 2018-11-14T16:24:25 Retool perf test running. This change does a few things involving the way we run the perf tests: - Perf test runner can capture different metrics Useful for capturing the new "nanoSecPerIteration" metric. - Removes the "score" metric We'll move to the new time-based metrics. These new metrics are scaled correctly with iteration counts. - Runs three trials per perf test This gives more measurements per test. Each trial is approximately one second. First the perf tests set a fixed number of iterations after calibrating the number of steps that we can run in one second. After that the three trials are run. This should give more stable results. - Apply more CPU stabilization on Windows Use SetPriorityClass to apply more CPU priority. Also upgrade SetThreadPriority to the highest level. - Always build the Vulkan command buffer test This catches build regressions more easily. We still skip the test on non-Android platforms. Bug: angleproject:2923 Change-Id: I7da234c5af07775ba4a232bb8d65e0138ee7073f Reviewed-on: https://chromium-review.googlesource.com/c/1330262 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 3402d523 2018-10-30T15:14:52 Try to reduce variance in angle_perftests. This change does a few things: - make perf test runner script print % variation instead of stddev This makes it a bit more clear how much variance there is. - stabilize CPU in the render perf tests Setting a thread affinity and priority should stop from switching cores during the run. Hopefully can prevent background noise from changing the test results. - warm up the benchmark with a few iterations This should hopefully make the test results a bit more stable. - output a new normalized perf result value The new result is normalized against the number of iterations. So it should hopefully be stable even if the number of iterations is changed. - increases the iteration count in the draw call perf tests. These tests were completely dominated by SwapBuffers time. Increasing the iterations per step means we actually are bottlenecked on CPU time instead. Bug: angleproject:2923 Change-Id: I5ee347cf93df239ac33b83dc5effe4c21e066736 Reviewed-on: https://chromium-review.googlesource.com/c/1303679 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Olli Etuaho bfeed4dd 2018-02-06T16:39:29 Add a compiler perf test shader to stress traversers Add a compiler perf test that's targeted at AST traversers. It triggers many traversers that mutate the AST and run multiple iterations particularly on the HLSL backend. BUG=angleproject:827 TEST=angle_perftests Change-Id: I75d89e8ae0fd7959f2c7fbb133c13ccde22abc37 Reviewed-on: https://chromium-review.googlesource.com/904622 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 1436d434 2018-01-24T14:38:22 Add a simple compiler perf test The perf test initializes the compiler once and then translates the same shader to HLSL, GLSL or ESSL repeatedly. There are three variations of the test compiling different shaders. One is a real-world shader. BUG=angleproject:2267 TEST=angle_perftests Change-Id: Ie07b67d7548d105c4c93dff3b6196233d83b5b8c Reviewed-on: https://chromium-review.googlesource.com/883784 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>