Repository navigation
perf(mobile): reduce chat feed sorting overhead - #12792
robertnisipeanu wants to merge 1 commit into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a localized mobile performance refactor that replaces repeated date-object sorting work with cached numeric timestamps while preserving feed ordering and entry reuse. Focused tests cover timezone ordering, stable ties, and input immutability, with no product-default or static-analysis changes. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesThread feed timestamp sorting
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
b9ecdf4 to
86af057
Compare
|
Thanks for working on this. We merged the orchestrator V2 rewrite in #2829, and we are closing this PR as part of that transition. The patch conflicts with the rewrite in apps/mobile/src/lib/threadActivity.ts. Even where the conflict is small enough to rebase, we are asking for fresh PRs against the new base so we can review and verify the behavior in V2. Sorry for the extra work this creates. If the change is still needed on V2, please rebuild it on current main, verify it there, and open a new PR linking back here. We're closing the current implementation without assuming the underlying request is resolved. |
Long mobile chat feeds pay for Date objects and generic tuple comparisons whenever messages update. Sort temporary numeric timestamp keys directly, preserving absolute-time ordering, stable ties, and the existing feed objects without adding a retained cache.
Validation: 109 focused feed tests, mobile package typecheck, targeted lint/format checks, and native iOS Release verification. The added test covers timezone offsets, equal timestamps, and unchanged source arrays.
Synthetic benchmark inside the native app’s Hermes engine: alternating baseline/patch order, four warmups and 40 measured feed rebuilds with a changed message per round. Median time fell from 8.61 to 5.43 ms for 1,000 rows and 50.18 to 31.22 ms for 4,000 rows; serialized output matched throughout. These are feed-computation measurements on an iOS Simulator, not end-to-end loading, physical-phone CPU/RAM, or battery measurements. All published benchmark inputs are invented.
Implemented with GPT-6 Astra (high reasoning) using the Codex harness.
Summary by CodeRabbit