Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolver perf: Optimise package exports
flattenLegacySubpathValues
…
…(1/n) (#1318) Summary: Pull Request resolved: #1318 The performance results from this stack are based on replaying the ~3000 resolutions performed during bundling RN Tester directly through `DependencyGraph.resolveDependency`. The baseline resolution time is ~1500ms on an M1 Max. (Internal: details in test plan) This is a self-contained optimsation to the `flattenLegacySubpathValues` step as part of exports map normalisation, which takes over 20% (360ms) of total resolver CPU time over 655 calls due largely to repeated object allocations and spreads. By mutating an intermediate object instead we get this down to ~16ms. Note that this still preserves key order - export maps are ordered. This reduces total resolution time from 1540ms -> 1171ms (-23%) Reviewed By: huntie Differential Revision: D56701232
- Loading branch information