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 Owner
Current Issue Owner: @Christinadobrzyn
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
Issue Owner
Current Issue Owner: @Christinadobrzyn