mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Performance optimization to allow paint to happen (up to) 1 frame earlier
Summary: Due to the way we're dispatching queued MountItems on Android, we could be doing nothing on the UI thread for up to 15.99...ms before the start of the next frame, resulting in a delayed paint of up to 1 full (16ms) frame. The delay is totally random and depends only on when the work is scheduled. The tl;dr is that currently all MountItems are dispatched starting only at the /beginning/ of a UI frame. If we schedule work at FrameStart+0.000001ms, it will not be operated on until the start of the next frame, 16ms later. So the "wasted" time could be anywhere from 0 to ~16ms, but will result in at least 1 wasted frame regardless. The fix is fairly trivial: start working on large buffered work as soon as we schedule it. Changelog: [Android][Changed] Optimization to paint changes up to 1 frame earlier on Android/Fabric Reviewed By: NickGerleman Differential Revision: D37478885 fbshipit-source-id: 8af846736caf3a9d9f0d0c5e33328bebb87b1b32
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3fa3aeba93
commit
3a7170ca52
@@ -140,4 +140,7 @@ public class ReactFeatureFlags {
|
||||
* Allow Differentiator.cpp and FabricMountingManager.cpp to generate a RemoveDeleteTree mega-op.
|
||||
*/
|
||||
public static boolean enableRemoveDeleteTreeInstruction = false;
|
||||
|
||||
/** Temporary flag to allow execution of mount items up to 15ms earlier than normal. */
|
||||
public static boolean enableEarlyScheduledMountItemExecution = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user