You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a clear before/after signal that decomposition reduced render pressure on the scan surface (time to interactive and/or subscription breadth).
Solution
Re-run the measurement scenario and expectations from the plan thread (e.g. FAB → scan ready on a reference device) and, if useful, summarize Onyx subscription differences per variant versus the old monolith.
I'm posting the measurement summary. @cristipaval Let me know if this is enough, or if you'd like us to explore the details further
Post-decomposition verification
Following the methodology I used on the WIP branch (#85571) as the baseline, here's the before/after on the same Android device
What changed
The monolithic IOURequestStepScanwas decomposed into a thin router + 4 focused variant components, each subscribing only to the Onyx data its flow actually needs:
Variant
Purpose
ScanEditReceipt
Replace receipt → navigate back
ScanFromReport
Set participants from report → confirmation
ScanGlobalCreate
Auto-reporting → navigate (the FAB path)
ScanSkipConfirmation
Direct submit, GPS gate, split bill
A shared Camera component + MultiScanContext was extracted alongside. The work landed across 4 sequential PRs (#87083, #87883, #89384, #89385).
TTI: FAB → Camera ready (Android, same device)
Flow: cold-start app → tap FAB → Create Expense → Scan → wait until viewfinder is live.
Metric
Pre-decomp (Apr 2026)
Post-decomp (Jun 2026)
ManualOpenCreateExpense avg
1337.2 ms
823.2 ms
Worst-case (max)
n/a
1032 ms
Per-iteration values Post-decomposition:
Iter
ManualOpenCreateExpense (ms)
ManualCameraInit (ms)
2
846
106
3
774
49
4
1032
2
5
905
53
6
877
2
7
703
8
8
685
26
9
698
50
10
889
141
Mean
823.2
48.6
Every single iteration is faster than the pre-decomp baseline - even the worst case is ~23% faster.
Onyx subscription footprint per variant
Counted at call-site level (each useOnyx / Onyx-backed hook in the variant file). Shared hooks like useDefaultExpensePolicy use selectors so their internal subscriptions are narrower than a raw collection sub.
Path
Subs (post)
Subs (monolith)
ScanEditReceipt
4
~27
ScanFromReport
3
~27
ScanGlobalCreate (FAB)
8
~27
ScanSkipConfirmation
~21
~27
The two most common interactive paths (ScanFromReport, ScanEditReceipt) now subscribe to 3–4 keys instead of ~27. Global Onyx chunk (new chat messages, report updates) no longer reaches them - addressing the parent issue's camera-jank root cause.
⚠️Important note - the -38% is not only because of the scan decomposition.
Roughly 2 months elapsed between the pre- and post-measurements. During that window, other performance-improvement initiatives also landed on main (selector additions to shared hooks, mount-path optimizations, related render-pressure reductions across IOU flows). The scan decomposition is one contributor but not the only driver of the headline number.
Some additional measures from Sentry
See the recent comment - aggregated p50/p90/p95 over real-user windows on both iOS and Android, showing meaningful improvements (Android p50 ManualEntryToScan -12.6%, -12.8% on ready; iOS p50 improvements up to -14.7% at p95) on the related FloatingCameraButton entry path. Different span and entry path than the local measurement above, but confirms the directional improvement at scale.
Conclusion
TTI on the FAB path improved -38% vs the pre-decomp baseline (1337 → 823 ms), with contributions from both the decomposition and other perf initiatives that landed in the same window.
Onyx subscription footprint dropped substantially on every variant, the two most common paths went from ~27 to 3–4
The refactors are looking good! I think we could stop here for now and switch to other flows, if there are no other immidiate candidates for improvements.
Activity
melvin-bot commentedon May 4, 2026
@bernhardoj Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
[-][IOURequestStepScan Decomposition] Verify perf + subscription counts post-decomposition[/-][+][HOLD] [IOURequestStepScan Decomposition] Verify perf + subscription counts post-decomposition[/+]cristipaval commentedon May 5, 2026
Held on #89385
melvin-bot commentedon May 8, 2026
@rinej Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
cristipaval commentedon May 11, 2026
still held
5 remaining items
cristipaval commentedon May 25, 2026
Still on hold
[-][HOLD] [IOURequestStepScan Decomposition] Verify perf + subscription counts post-decomposition[/-][+][IOURequestStepScan Decomposition] Verify perf + subscription counts post-decomposition[/+]cristipaval commentedon Jun 2, 2026
HOLD removed
cristipaval commentedon Jun 11, 2026
@rinej, could you please do the post-decomposition verification? 🙏
rinej commentedon Jun 16, 2026
yes, I will work on it
rinej commentedon Jun 17, 2026
I'm posting the measurement summary. @cristipaval Let me know if this is enough, or if you'd like us to explore the details further
Post-decomposition verification
Following the methodology I used on the WIP branch (#85571) as the baseline, here's the before/after on the same Android device
What changed
The monolithic
IOURequestStepScanwas decomposed into a thin router + 4 focused variant components, each subscribing only to the Onyx data its flow actually needs:ScanEditReceiptScanFromReportScanGlobalCreateScanSkipConfirmationA shared
Cameracomponent +MultiScanContextwas extracted alongside. The work landed across 4 sequential PRs (#87083, #87883, #89384, #89385).TTI: FAB → Camera ready (Android, same device)
Flow: cold-start app → tap FAB → Create Expense → Scan → wait until viewfinder is live.
ManualOpenCreateExpenseavgPer-iteration values Post-decomposition:
ManualOpenCreateExpense(ms)ManualCameraInit(ms)Every single iteration is faster than the pre-decomp baseline - even the worst case is ~23% faster.
Onyx subscription footprint per variant
Counted at call-site level (each
useOnyx/ Onyx-backed hook in the variant file). Shared hooks likeuseDefaultExpensePolicyuse selectors so their internal subscriptions are narrower than a raw collection sub.ScanEditReceiptScanFromReportScanGlobalCreate(FAB)ScanSkipConfirmationThe two most common interactive paths (
ScanFromReport,ScanEditReceipt) now subscribe to 3–4 keys instead of ~27. Global Onyx chunk (new chat messages, report updates) no longer reaches them - addressing the parent issue's camera-jank root cause.Roughly 2 months elapsed between the pre- and post-measurements. During that window, other performance-improvement initiatives also landed on
main(selector additions to shared hooks, mount-path optimizations, related render-pressure reductions across IOU flows). The scan decomposition is one contributor but not the only driver of the headline number.Some additional measures from Sentry
See the recent comment - aggregated p50/p90/p95 over real-user windows on both iOS and Android, showing meaningful improvements (Android p50
ManualEntryToScan-12.6%, -12.8% on ready; iOS p50 improvements up to -14.7% at p95) on the related FloatingCameraButton entry path. Different span and entry path than the local measurement above, but confirms the directional improvement at scale.Conclusion
Julesssss commentedon Jun 17, 2026
The refactors are looking good! I think we could stop here for now and switch to other flows, if there are no other immidiate candidates for improvements.
👍 achieved
cristipaval commentedon Jun 17, 2026
yeah, I think it looks good. In practice I can feel that the feature works smoother 👍