Skip to content

Add iOS typing perf automation and profiling workflows#418

Draft
futurepaul wants to merge 1 commit intosledtools:masterfrom
futurepaul:perf-test
Draft

Add iOS typing perf automation and profiling workflows#418
futurepaul wants to merge 1 commit intosledtools:masterfrom
futurepaul:perf-test

Conversation

@futurepaul
Copy link
Collaborator

Summary

This PR adds an iOS typing-performance workflow focused on composer keypress responsiveness and UI-thread work during typing.

It introduces:

  • A dedicated iOS UI perf test suite for typing latency in TypingPerfUITests.
  • New just one-liners for summary, trace capture, keypress stack analysis, and samply profiling.
  • Symbolized Time Profiler attach-mode analysis that reports per-keypress averaged stack hotspots and writes flamegraph artifacts.
  • App-side keypress signposts in ChatView to correlate text changes with sampled work.
  • Simulator/Xcode runtime selection improvements to avoid destination/runtime mismatch failures.
  • nix shell additions for inferno and samply.
  • A new guide: docs/perf-testing.md.

New commands

  • just ios-typing-perf
    • Prints one-line key findings (avg, best, worst, samples, plus bulk baseline when available).
  • just ios-typing-perf-trace
    • Captures/open Time Profiler trace while running typing perf.
  • just ios-typing-perf-keypress-profile
    • Exports per-keypress averaged stacks + folded output.
  • just ios-typing-perf-keypress-profile-symbolized
    • Attach-mode symbolized stack collection + flamegraph SVG.
  • just ios-typing-perf-samply
    • Attempts samply attach profiling for app PID.
    • Includes attach retries and local codesigning of nix-store samply copy.
    • Falls back to symbolized xctrace flow by default when samply hits known attach instability.

Why fallback exists

On macOS simulator attach, samply can intermittently panic with:

  • Could not check process libraries
  • InvalidAddress

To keep the one-liner reliable for day-to-day perf diagnosis, the script falls back to ios-typing-perf-keypress-profile-symbolized unless explicitly disabled.

Scope / current limitations

  • This is focused on typing-path instrumentation and profiling mechanics.
  • The test currently opens note-to-self chat and measures composer typing.
  • It does not yet include a synthetic 10k-message fixture load path.

Validation done

  • bash -n sanity checks for all added/updated shell tooling.
  • End-to-end runs of:
    • ios-typing-perf
    • ios-typing-perf-keypress-profile-symbolized
    • ios-typing-perf-samply (including fallback behavior)

# Conflicts:
#	ios/Sources/Views/ChatView.swift
@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 271726f5-cfdb-4302-bcda-66c61eb30713

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

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