Commits
Click on a commit to change the comparison rangeperf: cache canonicalization results at every recursion level
Moves path.canonicalized.get_or_init() from canonicalize_impl() into
the recursive canonicalize_with_visited() function. This enables
caching of parent directory canonicalization results, which are then
reused when canonicalizing sibling paths.
Performance impact (measured with many example on monitor-oxc):
- Total filesystem syscalls: 124,071 → 39,296 (-68.3%)
- symlink_metadata calls: 99,169 → 17,503 (-82.4%)
- read_link calls: 6,127 → 3,018 (-50.7%)
The optimization is particularly effective for:
- Projects with deep node_modules structures
- pnpm workspaces (heavy symlink usage)
- Parallel resolution of multiple packages
All existing tests pass with no behavior changes.