Skip to content

perf(iOS): avoid blocking a worker during component render - #8359

Open
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/avoid-blocking-render-thread
Open

perf(iOS): avoid blocking a worker during component render#8359
OskarEichler wants to merge 1 commit into
wix:masterfrom
OskarEichler:codex/avoid-blocking-render-thread

Conversation

@OskarEichler

Copy link
Copy Markdown

Performance problem and fix

RNNStackPresenter.renderComponents dispatched to a global high-priority queue, dispatched setup back to the main queue, then blocked the global worker with dispatch_group_wait(..., DISPATCH_TIME_FOREVER) until the React top-bar background reported ready.

For waitForRender components, a slow or failed render could occupy that worker indefinitely. The worker and synchronization primitive are unnecessary because readiness is already callback-based.

This change keeps setup asynchronous on the main queue and forwards readiness back to the main queue without blocking any worker. Completion ordering and main-thread delivery remain unchanged.

Regression coverage

The presenter test now exercises the render callback path and verifies completion is delivered on the main thread. The focused presenter suite passes 10/10.

Verification

  • New Architecture iOS build-for-testing succeeded
  • RNNStackPresenterTest: 10/10 passed on an iPhone 16 Pro simulator (iOS 26.5)
  • clang-format and git diff --check passed

Breaking changes

None. This removes internal blocking while preserving asynchronous callback order and thread affinity.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant