From d3f660f3888092938d4e30c94b6570911a038742 Mon Sep 17 00:00:00 2001 From: jinouye Date: Tue, 15 Aug 2023 11:14:39 -0500 Subject: [PATCH] Update content: Remove "Debugging animation jank" from Android environment. Remove "Arc graphics tracing" from Performance profiling. --- site/en/android-environment/animation.md | 53 --------------------- site/en/games/optimizing-games-profiling.md | 6 --- 2 files changed, 59 deletions(-) delete mode 100644 site/en/android-environment/animation.md diff --git a/site/en/android-environment/animation.md b/site/en/android-environment/animation.md deleted file mode 100644 index 3fef669c..00000000 --- a/site/en/android-environment/animation.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Debugging animation jank -metadesc: Using the ARC graphics tracer to ensure ensure smooth, glitchless, jank-free animations for apps. -date: 2020-05-01 -weight: -5 -tools: - - name: Chrome OS - url: / - versions: - min: 75 - max: current -tags: - - high-performance graphics - - developer tools ---- - -One of the most difficult problems for app developers is ensuring smooth, glitchless, and jank-free animation. This is especially hard to debug when the system is also performing resource-intensive background tasks. There is no easy way to determine if some jank is caused by your app or the system. However, there is a profiler tool which can help you identify the possible source of the bad behavior. - -## Rendering on Chrome OS - -A fine-tuned app, like a game, usually uses double buffering to keep the user response time as low as possible. Still, there are many things that can degrade performance. For example, if it takes too long to render a frame, the rendered result is not ready for the next buffer swap, and consequently the previous frame is repeated. Then, the renderer cannot start rendering the next frame, causing even more problems. This scenario is familiar to "pure" Android developers. When an app runs on Chrome OS the context is even more complicated. - -An app running on the desktop does not render directly to the screen's display frame. It renders its data into a texture instead. There are usually multiple apps, each rendering its graphics into a texture. The system constructs the view on the screen using a compositor to combine all the textures into a single desktop image. - -The compositor works transparently in the background. However, it introduces a one-frame time delay to maximize the use of the GPU pipeline. In an ideal world this might not be necessary, but this smooths system performance fluctuations and helps balance an asymmetrical load. - -When the OS is working very hard, the GPU might get squeezed. There can be an additional delay from the time a frame is rendered to when it appears on the screen. The system might use quadruple buffering to compensate (this is hardware dependent). Even with deeper buffering, the graphic pipeline could still glitch. - -## The ARC graphics tracer - -Chrome OS has a profiling tool that shows how the buffers are percolating through the system, when memory swaps occur, how busy the CPU/GPU is, and what your application is doing at a given time: - -![Jank Profiler, with ARC++ app running on the left and CPU, Memory, Chrome Graphics, and Android Graphics information to the right.](ix://develop/android/animation/jank-profiler.png) - -### Setting up the profiler - -To use the profiler you must run M75 or later. For best results, we recommend using an Intel device. - -Before using the profiler you should seed your app with traces. Add `Trace.traceCounter(Trace.TRACE_TAG_GRAPHICS, "Event", <number>);` to your code wherever you'd like to include a trace. The `Event` that you use should begin with the prefix `customTrace.`. The prefix will not appear in the trace message. - -To set up the profiler, follow these steps: - -1. Turn on developer mode. -2. Turn on Chrome settings and enable the **ARC graphic buffers visualization tool**. -3. Navigate to `chrome://arc-graphics-tracing`. - -### Running the profiler - -1. Check **stop on jank**. -2. Run the Android app. -3. When the Android app is active and has focus, press [[Ctrl]]+[[Shift]]+[[G]]. - -When some jank happens, the browser window will pop up. Use the [[w]] and [[s]] keys to zoom and shrink the timeline. diff --git a/site/en/games/optimizing-games-profiling.md b/site/en/games/optimizing-games-profiling.md index 39ba733e..3f91232c 100644 --- a/site/en/games/optimizing-games-profiling.md +++ b/site/en/games/optimizing-games-profiling.md @@ -51,12 +51,6 @@ Another useful ARM device profiler is [ARM Mobile Studio](https://developer.arm. The [Android GPU Inspector](https://gpuinspector.dev/) is a new tool developed by Google and specifically designed to help you get the best performance out of your game with both OpenGL and Vulkan. It is currently in a developer preview state and may take some work to get set up and is currently only working on a handful of devices. It promises to be one of the major tools to use for graphics profiling in the future. See the [official documentation](https://gpuinspector.dev/docs/). -### ARC Graphics Tracing - -Chrome OS has a built-in graphics profiler that helps you understand how your Android game is interacting with the desktop compositor. It can help you get a global view of the operating system and see if glitches are occurring because your game is not producing frames fast enough or if other pieces of the system are utilizing the CPU. You can include custom tracing tags in your app to narrow down which parts of your code are responsible for missing rendering windows. - -Start the tracing tool by navigating to `chrome://arc-graphics-tracing` in the browser on Chrome OS. Detailed usage instructions can be found on [debugging animation jank](/{{locale.code}}/android-environment/animation). - ### ARC Overview Tracing There's also a more generalized tool - ARC Overview Tracing - that works similarly to the above ARC Graphics Tracing tool. This tracer will provide high-level metrics about an app and Chrome OS performance. Read outs will show you FPS of the app and of Chrome itself, as well as CPU usage, GPU usage, power consumption, and more. You can run the tool multiple times and see graphs for each run overlaid together with colors to differentiate them. Each tracing model will be saved to your Downloads folder and can be reimported for future comparisons. For general app health checks, ARC Overview Tracing is a good place to start.