Skip to content

perf(cache): remove package.json index arena indirection#1003

Merged
Boshen merged 2 commits intomainfrom
perf/remove-package-json-index-indirection
Feb 8, 2026
Merged

perf(cache): remove package.json index arena indirection#1003
Boshen merged 2 commits intomainfrom
perf/remove-package-json-index-indirection

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Feb 8, 2026

Summary

  • remove PackageJsonIndex indirection in cached paths
  • store Option<Arc<PackageJson>> directly in CachedPath::package_json
  • remove cache-level package_jsons arena (RwLock<Vec<Arc<PackageJson>>>)
  • simplify find_package_json to return cached package json directly

Motivation

This removes one lookup/lock layer from package.json resolution hot paths while preserving behavior.

Testing

  • just ready

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.06%. Comparing base (9705e35) to head (b001371).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1003      +/-   ##
==========================================
- Coverage   94.08%   94.06%   -0.03%     
==========================================
  Files          18       18              
  Lines        3416     3404      -12     
==========================================
- Hits         3214     3202      -12     
  Misses        202      202              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Boshen Boshen force-pushed the perf/remove-package-json-index-indirection branch from d64f875 to c4d372f Compare February 8, 2026 10:47
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 8, 2026

Merging this PR will improve performance by 4.88%

⚡ 1 improved benchmark
✅ 12 untouched benchmarks
⏩ 5 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
resolver_real[multi-thread] 474.4 µs 452.3 µs +4.88%

Comparing perf/remove-package-json-index-indirection (b001371) with main (9705e35)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Boshen Boshen merged commit 1f7b08a into main Feb 8, 2026
18 checks passed
@Boshen Boshen deleted the perf/remove-package-json-index-indirection branch February 8, 2026 11:19
This was referenced Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant