Skip to content

[Due for payment 2025-09-12] [$125] Accelerate createOptionList Performance Through Targeted OptionData Optimization #67123

Description

@roryabraham

Proposal: Accelerate createOptionList Performance Through Targeted OptionData Optimization

Background

The createOptionList function is a critical performance bottleneck in Expensify's UI, called every time users open chat lists, search for participants, or navigate between screens. It processes hundreds of reports and personal details to generate option objects using the comprehensive OptionData interface. Each call creates massive arrays of objects with 50+ properties per option, even though only a subset is needed. The function runs synchronously on the main thread, and in large workspaces, users experience noticeable delays. Memory allocation overhead further impacts performance due to initialization of unused properties.

Problem

When createOptionList processes large datasets, it allocates memory and CPU cycles for 50+ OptionData properties per option, even though only 42 are used in search contexts. This prevents optimal performance in high-frequency operations.

Solution

Create a SearchOptionData type with only the 42 properties needed in search/list contexts.Reduce memory allocation by ~16% per option and eliminate CPU cycles for unused fields.
Optimize createOption to compute only essential properties, skipping expensive calculations (e.g., complex report state).
Update createOptionList and related functions to return SearchOptionData[] instead of full OptionData[].
Retain the existing OptionData interface for detailed views—no breaking changes.

Impact:
This optimization will reduce memory usage, cut unnecessary computations, and improve responsiveness during common operations like opening chat lists or participant searches.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021948515734368471809
  • Upwork Job ID: 1948515734368471809
  • Last Price Increase: 2025-07-24
Issue OwnerCurrent Issue Owner: @Christinadobrzyn

Metadata

Metadata

Labels

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

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions