Skip to content

[HOLD for payment 2025-09-12] [$250] Improve recomputeDerivedValue performance during expense creation workflow #69237

Description

@mountiny

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 OwnerCurrent Issue Owner: @stephanieelliott

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions