mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Move reporting of long tasks to before updating rendering (#46252)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46252 Changelog: [internal] The long task API should only account for work specifically done by the task. Updating the rendering shouldn't be considered for that, so this moves the determination of long tasks before doing that work. Reviewed By: sammy-SC, rshest Differential Revision: D61939261 fbshipit-source-id: 6d2573d561d507dff60b9703e4cc90ce4d131960
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8501b6396b
commit
a0909efbec
+5
-5
@@ -335,17 +335,17 @@ void RuntimeScheduler_Modern::runEventLoopTick(
|
||||
performMicrotaskCheckpoint(runtime);
|
||||
}
|
||||
|
||||
if (ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop()) {
|
||||
// "Update the rendering" step.
|
||||
updateRendering();
|
||||
}
|
||||
|
||||
if (ReactNativeFeatureFlags::enableLongTaskAPI()) {
|
||||
auto taskEndTime = now_();
|
||||
markYieldingOpportunity(taskEndTime);
|
||||
reportLongTasks(task, taskStartTime, taskEndTime);
|
||||
}
|
||||
|
||||
if (ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop()) {
|
||||
// "Update the rendering" step.
|
||||
updateRendering();
|
||||
}
|
||||
|
||||
currentTask_ = nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user