From 1f6065f44763a2dcd3261ae9595b8fe8ca17e6ad Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Sat, 14 Oct 2017 00:34:35 +0000 Subject: [PATCH] Updated docs for next --- releases/next/docs/performance.html | 149 +++++++++++++++++++++++++++- 1 file changed, 148 insertions(+), 1 deletion(-) diff --git a/releases/next/docs/performance.html b/releases/next/docs/performance.html index 7318d63ab00..7538642708b 100644 --- a/releases/next/docs/performance.html +++ b/releases/next/docs/performance.html @@ -107,7 +107,154 @@ Here's a zoom-in of the JS thread from the trace above:

shouldComponentUpdate.

Resolving native UI Issues #

If you identified a native UI problem, there are usually two scenarios:

  1. the UI you're trying to draw each frame involves too much work on the GPU, or
  2. You're constructing new UI during the animation/interaction (e.g. loading in new content during a scroll).
Too much GPU work #

In the first scenario, you'll see a trace that has the UI thread and/or Render Thread looking like this:

Overloaded GPU

Notice the long amount of time spent in DrawFrame that crosses frame boundaries. This is time spent waiting for the GPU to drain its command buffer from the previous frame.

To mitigate this, you should:

If these don't help and you want to dig deeper into what the GPU is actually doing, you can check out Tracer for OpenGL ES.

Creating new views on the UI thread #

In the second scenario, you'll see something more like this:

Creating Views

Notice that first the JS thread thinks for a bit, then you see some work done on the native modules thread, followed by an expensive traversal on the UI thread.

There isn't an easy way to mitigate this unless you're able to postpone creating new UI until after the interaction, or you are able to simplify the UI you're creating. The react native team is working on a infrastructure level solution for this that will allow new UI to be created and configured off the main thread, allowing the interaction to continue smoothly.

← PreviousContinue Reading →

Improve this page by sending a pull request!