Skip to content

[$250] Improve UserSelectPopup performance when selecting users #66931

Description

@mountiny

Coming from here

Background:

UserSelectPopup handles large datasets of personal details and reports. The getValidOptions() function performs costly filtering and cross-referencing on every interaction. Users with heavy accounts need to select multiple people from huge contact lists containing hundreds or thousands of entries. The current implementation processes selection state checks for every item in the list against every selected item.

Problem:

When users select people in UserSelectPopup with large contact lists, in the component are delays and UI lags, which prevents users from efficiently completing their selection tasks.

Solution:

Replace selectedOptions.some() with Set-based O(1) lookups

  • Memoize initial selectedOptions computation
  • Refactor selectUser with filter() for cleaner, more efficient logic
  • With the change we were able to reduce the render time by 200ms and reduce renders by 1
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021947959328313625345
  • Upwork Job ID: 1947959328313625345
  • Last Price Increase: 2025-07-23
Issue OwnerCurrent Issue Owner: @rinej

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

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