Skip to content

PAM Native 1.43.1

Choose a tag to compare

@DavidWilliamBalbino DavidWilliamBalbino released this 15 Oct 05:28
· 617 commits to main since this release

PAM Native 1.43.1 (on top of 1.43.0) is a performance patch. Idle or hidden work stops waking the app. No API or protocol change.

  • Off-screen spinners stop ticking (Android). ActivityIndicator and the Button loading arc started their infinite animator as soon as the renderer created them, even when they were never attached. A spinner in a prewarmed or hidden subtree drove Choreographer frames forever, in the background too. On the Zé Chat inbox (S10), that meant about 60 main-thread wakeups/s and 4-5% CPU while idle. The loop now runs only while its host is attached, shown and in a visible window. It pauses when the host leaves and resumes on its next draw. iOS spinners already animated only inside a window.
  • ScrollView offset requests wait for layout (Android). A requested content offset (contentOffsetX/Y, initial offsets, scroll requests) on a container that is not laid out yet (GONE, never measured, or still without content) is now applied on the container's next layout. Before, it re-posted itself to the UI thread on every looper iteration for as long as the container stayed unlaid. With a feed video playing, this kept the main thread at about 64% CPU. iOS applies offsets from layout and has no such retry.
  • DeviceStatus::watch() delivers changes only. The first status is delivered, then only changes. Android replaces the per-interval main-thread poll (three binder calls and a PHP callback every interval, in the background too) with the default network callback and the battery/power-save broadcasts. Changes closer together than the interval are coalesced. iOS keeps its timer but drops unchanged samples.
  • Navigator::prewarm($route, $params, releaseAfterMs: null). With null, the warm screen stays until another navigation, cancelPrewarm() or trimMemory(), instead of being released after 4 s unused. A screen that keeps its first row warm while idle no longer renews it with a timer. Each renewal woke PHP and ran two render passes, about 40 wakeups/min on the Zé Chat inbox. The default stays 4 s. This change is PHP only.
  • Media3 in the Android baseline profile. ExoPlayer, common, decoder, datasource and extractor are now in the profile, so with speed-profile the playback loop no longer runs interpreted. On the S10, a feed video went from 66% to 56% process CPU (ExoPlayer playback thread 13% → 9%, codec callbacks 9.5% → 6%).

Guides: docs/navigation.md (prewarm), docs/production-capabilities.md (DeviceStatus), docs/ios-parity.md (Mac checklist). Tests: instrumented PamOffscreenSpinnerInstrumentedTest and PamScrollOffsetWaitInstrumentedTest, JVM DeviceStatusChangesTest, XCTest DeviceStatusChangesTests (not compiled on Linux), and the PHP SDK contract.