Skip to content

perf(mobile): run reorder frames only during a drag - #638

Merged
nixuuu merged 1 commit into
devfrom
perf/mobile-reorder-frames
Nov 13, 2026
Merged

nixuuu merged 1 commit into
devfrom
perf/mobile-reorder-frames

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Selecting Custom thread ordering kept a Reanimated frame callback registered even when no gesture was active. Register frames only during a drag, stop on finalization/suspension/unmount, and check the active row before accepting a queued start.

Fixes: #626

Instrumented path Before After
Custom ordering, idle UI callbacks over 120 simulated seconds at 60 Hz 7,200 0
One-second drag, then 120 seconds idle — 60 drag callbacks, 0 idle callbacks

Method: temporary instrumentation outside the repository executes the production hook with mocked native bindings and a simulated frame clock. Counts show callback registration, not native CPU, FPS, React renders, hardware wakeups or battery use. The loop already runs on the UI thread; this change removes its idle registration.

Native profiling is unavailable: T3 reports Could not communicate with device support. Try refreshing devices. Refreshing once did not restore access. The installed Android app was in DevLauncherErrorActivity, so its CPU/frame data cannot serve as a Canopy baseline. All five requested scenarios (Working list, streaming thread, idle thread, PR panel and two-minute idle list) still lack valid iOS/Android CPU, JS/UI FPS, renders/s, wakeups and measured network rates. This PR does not claim to resolve foreground heating.

Validation uses nice -n 10: install, gen:check, full typecheck, repository lint, format:check, web build, both native JS/Hermes exports (approximately 12 MB each) and the temporary drag/idle probe passed on this independent branch. Full check:tmp also passed on the combined changes: 2,749 passed, 166 skipped, zero failures, and nothing left in the checked temp directory. All CI checks passed at this head. Expo ESLint retains pre-existing findings with no new source file/rule errors. Native visual verification remains blocked by device support. No UI tests, native dependencies, EAS builds, release builds or publication. UI copy is unchanged.

This is a JavaScript-only change. Both independent branches retain the native fingerprints under the same local stable config:

  • iOS: 74705db3a68907bc28379bb9b1080a227bc0755b
  • Android: 7d38be8f5c9bf842d62060c75820a206f99c87e3

Custom ordering registered a UI frame callback even with no active gesture. Start it on activation, stop it on finalization or suspension, and reject delayed starts after the drag ends.

Fixes: #626
@nixuuu
nixuuu marked this pull request as ready for review November 13, 2026 11:59
@nixuuu
nixuuu merged commit 2b991fd into dev Nov 13, 2026
12 checks passed
@nixuuu
nixuuu deleted the perf/mobile-reorder-frames branch November 13, 2026 12:01
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