Coming from this proposal.
Background:
The recomputeDerivedValue system processes report data changes to compute derived values like report attributes, names, and status indicators. When users create expenses, multiple report dependencies trigger recomputations across the system.
Problem:
The create expenses flow in high-traffic accounts. might take up to ~4 seconds to complete
Solution:
Add some optimizations which sum up to the performance gains:
- Reuse context objects instead of creating new ones during each computation to reduce memory allocation.
- Replace nested forEach loops with for...of loops for better performance by avoiding additional function call overhead.
- Implement early return checks before performing expensive operations to skip unnecessary computations.
Draft PR: https://github.com/Expensify/App/pull/67417/files
Before: 4223ms
After: 3561ms
Tested on high-traffic account with 4x CPU slowdown
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021960304743734027858
- Upwork Job ID: 1960304743734027858
- Last Price Increase: 2025-08-26
Issue Owner
Current Issue Owner: @stephanieelliott
Coming from this proposal.
Background:
The recomputeDerivedValue system processes report data changes to compute derived values like report attributes, names, and status indicators. When users create expenses, multiple report dependencies trigger recomputations across the system.
Problem:
The create expenses flow in high-traffic accounts. might take up to ~4 seconds to complete
Solution:
Add some optimizations which sum up to the performance gains:
Draft PR: https://github.com/Expensify/App/pull/67417/files
Before: 4223ms
After: 3561ms
Tested on high-traffic account with 4x CPU slowdown
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @stephanieelliott