Skip to content

docs(mobile/v4): performance guide + field-notes from building an app - #451

Draft
LukeTowers wants to merge 1 commit into
NativePHP:mainfrom
LukeTowers:docs/mobile-v4-performance-notes
Draft

docs(mobile/v4): performance guide + field-notes from building an app#451
LukeTowers wants to merge 1 commit into
NativePHP:mainfrom
LukeTowers:docs/mobile-v4-performance-notes

Conversation

@LukeTowers

Copy link
Copy Markdown

Draft — opening early so it can grow in small, reviewable commits as I keep building a real NativePHP Mobile v4 app and hit things the docs don't yet cover. Each item below lands as its own commit; happy to split into separate PRs if maintainers prefer.

Included so far

  • digging-deeper/performance.md — a practical performance guide. The architecture pages (render-publish-mount, subtree-reuse) document the mechanism well, but there's no developer-facing "why does this tap feel heavy / what do I do" page. This one covers:
    • what a tap costs (event → render → publish → diff+paint), and that reactivity is per-screen — child components are composition, not independent update boundaries (a real point of confusion: it's tempting to split into child components expecting isolated re-renders);
    • that native diff + paint scale with on-screen node count even when little changed — so node count is the practical lever, which slightly nuances the "it's basically free" framing of subtree-reuse;
    • levers in order (key lists, flatten the tree, split heavy screens into their own route, components-for-reuse-not-isolation, lean polling);
    • how to measure with the built-in BenchmarkComponent (event/diff/paint breakdown), with the real-device caveat (simulator RTT/FPS is unreliable; per-stage breakdown still useful).

Planned (separate commits, as I hit/confirm them)

  • @navigate quoting gotcha in the routing docs — @navigate='/route' (single quotes = short route form, auto-quoted) vs @navigate="…" (double quotes = raw PHP args). The mismatch is a silent compile break.
  • Tooling prerequisitesnative:watch requires Watchman (brew install watchman); iOS UI automation (idb) requires the standalone Command Line Tools. Small setup-doc additions.
  • Anything else that trips me up while building that turns out to be undocumented.

Notes

🤖 Generated with Claude Code

The architecture pages document the render/publish/mount pipeline and subtree
reuse thoroughly, but there's no developer-facing "why is my tap heavy / what
do I do" page. Add digging-deeper/performance.md covering:

- what a tap costs (event → render → publish → diff+paint) and that reactivity
  is per-screen (child components are composition, not update boundaries);
- that native diff + paint scale with on-screen node count even when little
  changed — the practical lever;
- levers in order: key lists, flatten the tree, split heavy screens into their
  own route, use child components for reuse (not isolation), keep polling lean;
- how to measure with the built-in BenchmarkComponent (event/diff/paint
  breakdown), with the real-device caveat.
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