- Add a debug diff scratch route with fixture-driven highlighting - Wrap review screen in a shared highlighter provider - Document profiling steps and add a Hermes profiling script
2.4 KiB
Review Screen Profiling
Use this when the mobile review screen is slow or crashes while opening large diffs.
Preferred Capture: React Native DevTools Performance
This app is on Expo SDK 55 / React Native 0.83 with Hermes, so the best first trace is the React Native DevTools Performance recording. The review screen also emits t3.review.* user timing marks in development builds so the trace can show parse, list-building, row indexing, and syntax-highlighting work.
-
Start the development client:
cd apps/mobile bun dev:client -
Open the app in the iOS Simulator or on the device using the development client.
-
In the terminal running Expo, press
jto open React Native DevTools. -
In DevTools, open the
Performancepanel. -
Start recording.
-
In the app, reproduce the slow path:
- Navigate to the thread.
- Open
Files Changed. - Select the largest review source.
- Expand a few large files or tap
Load diff. - Scroll until the app is clearly slow or until just before it crashes.
-
Stop recording.
-
Export or save the Performance recording as a JSON trace.
Send that exported trace file here. Also include the device/simulator model and whether it was iOS or Android.
Android Fallback: Hermes Sampling Profile
Use this if the app crashes before DevTools can export a trace, or if we need deeper JavaScript stack samples.
-
Run Android dev client:
cd apps/mobile bun android:dev bun dev:client -
Open the developer menu from the Expo terminal with
d. -
Select
Enable Sampling Profiler. -
Reproduce the review-screen slowdown.
-
Open the developer menu again with
d. -
Select
Disable Sampling Profiler. -
Pull and convert the Hermes profile:
cd apps/mobile mkdir -p profiles/review bunx react-native profile-hermes profiles/review -
Send the generated Chrome trace/profile file from
apps/mobile/profiles/review.
For the development app variant, the Android package is com.t3tools.t3code.dev.
What To Capture
For the first trace, do not optimize the repro. We want the slowest realistic case:
- A diff with many files and large line counts.
- At least one
Load diffaction for a suppressed large diff. - One vertical scroll pass after the content appears.
- One horizontal scroll of a long file, if that is part of the slowdown.
If the app crashes, note the last visible action before the crash and attach device logs if available.