Skip to content

Add tracing instrumentation to shared animation backend#56778

Open
bartlomiejbloniarz wants to merge 4 commits into
mainfrom
export-D102800179
Open

Add tracing instrumentation to shared animation backend#56778
bartlomiejbloniarz wants to merge 4 commits into
mainfrom
export-D102800179

Conversation

@bartlomiejbloniarz
Copy link
Copy Markdown
Contributor

Summary:
Add TraceSection annotations to the shared animated backend so the work it performs becomes visible in systrace / Perfetto / Android Studio System Trace captures.

Instrumented entry points:

  • AnimationBackend::onAnimationFrame
  • AnimationBackend::applySurfaceUpdates
  • AnimationBackend::commitUpdates
  • AnimationBackend::synchronouslyUpdateProps and its three platform variants
    (Buffered, Unbuffered, WithAnimatedProps)
  • AnimationBackend::requestAsyncFlushForSurfaces
  • AnimationBackendCommitHook::shadowTreeWillCommit
  • AnimatedPropsRegistry::update
  • AnimatedPropsRegistry::getMap

Each section includes contextual args (surfaceId / surface count / update count) where available to make traces easier to correlate when investigating animation perf.

Changelog:
[General][Added] - Add TraceSection instrumentation to the shared animation backend so its work shows up in systrace / Perfetto / Android Studio System Trace captures

Reviewed By: christophpurrer

Differential Revision: D102800179

Bartlomiej Bloniarz and others added 4 commits May 11, 2026 07:14
Summary:
Pull Request resolved: #56468

Wire the delegate chain for batched animated property updates through UIManager, Scheduler, and the platform-specific SurfaceManagers. iOS and CxxPlatform get no-op stubs. Gated behind the `optimizedAnimatedPropUpdates` feature flag, so this change has no behavioural impact when the flag is off.

Changelog:
[Android][Added] - Add a batched animated prop update path that applies all pending C++ animation backend updates via a single mount item (gated by `optimizedAnimatedPropUpdates`)

Differential Revision: D101157453
Summary:
Pack animated property updates into a compact byte+double buffer format in C++ and add the corresponding Java-side buffer decoder. This avoids per-property JNI calls by batching all updates into a single cross-boundary transfer.

Gated behind the `optimizedAnimatedPropUpdates` feature flag.

Changelog:
[Android][Changed] - Pack animated prop updates from the C++ animation backend into a single byte+double buffer instead of issuing one JNI call per property (gated by `optimizedAnimatedPropUpdates`)

Differential Revision: D101157452
Summary:
Add an iOS-optimized code path that passes typed AnimatedProps directly through the delegate chain, avoiding the folly::dynamic serialization round-trip. Android and CxxPlatform get no-op stubs. Gated behind the `optimizedAnimatedPropUpdates` feature flag.

Changelog:
[iOS][Added] - Add a direct AnimatedProps update path through `RCTScheduler` / `RCTMountingManager` that bypasses the folly::dynamic serialization round-trip (gated by `optimizedAnimatedPropUpdates`)

Differential Revision: D101157449
Summary:
Add TraceSection annotations to the shared animated backend so the work it performs becomes visible in systrace / Perfetto / Android Studio System Trace captures.

Instrumented entry points:
- AnimationBackend::onAnimationFrame
- AnimationBackend::applySurfaceUpdates
- AnimationBackend::commitUpdates
- AnimationBackend::synchronouslyUpdateProps and its three platform variants
  (Buffered, Unbuffered, WithAnimatedProps)
- AnimationBackend::requestAsyncFlushForSurfaces
- AnimationBackendCommitHook::shadowTreeWillCommit
- AnimatedPropsRegistry::update
- AnimatedPropsRegistry::getMap

Each section includes contextual args (surfaceId / surface count / update count) where available to make traces easier to correlate when investigating animation perf.

Changelog:
[General][Added] - Add `TraceSection` instrumentation to the shared animation backend so its work shows up in systrace / Perfetto / Android Studio System Trace captures

Reviewed By: christophpurrer

Differential Revision: D102800179
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 12, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels May 12, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 12, 2026

@bartlomiejbloniarz has exported this pull request. If you are a Meta employee, you can view the originating Diff in D102800179.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant