Skip to content

Use Set instead of Array for recentlyAccessedKeys #643

@kacper-mikolajczak

Description

@kacper-mikolajczak

Background

https://expensify.slack.com/archives/C05LX9D6E07/p1750073823574879?thread_ts=1749725055.638059&cid=C05LX9D6E07

Problem
recentlyAccessedKeys in OnyxCache is implemented as an Array which has O(n) read/write performance characteristics. It is a LRU but having faster access type should be nice

Solution
Convert recentlyAccessedKeys to Set so we end up with O(1) complexity.

Expected results
Improvement should be visible in the reassure performance tests deltas

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions