Skip to content

module: keep ESM load cache entries in fast mode - #66276

Open
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:module/fast-esm-load-cache
Open

mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:module/fast-esm-load-cache

Conversation

@mcollina

Copy link
Copy Markdown
Member

Keep per-URL load cache entries in fast-property mode while preserving their null prototype.

Median throughput from five alternating runs on matched Release builds (operations/s; higher is better):

Workload Before After Change
Load-cache hit, 1 URL 48,976,708 99,289,555 +102.7%
Load-cache hit, 100 URLs 36,544,017 78,364,669 +114.4%
Repeated import, node:os 79,966 79,219 −0.9%
Repeated import, relative module 74,713 75,774 +1.4%
Cold imports, distinct data URLs 12,236 12,455 +1.8%

Keep per-URL load cache entries in fast-property mode while
   preserving their null prototype.

Assisted-by: Pi
Signed-off-by: Matteo Collina <hello@matteocollina.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/performance

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. labels Sep 25, 2026
@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.33%. Comparing base (e7d8ab5) to head (da595c3).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66276      +/-   ##
==========================================
+ Coverage   90.30%   90.33%   +0.03%     
==========================================
  Files         789      790       +1     
  Lines      272880   273835     +955     
  Branches    52110    52370     +260     
==========================================
+ Hits       246418   247375     +957     
- Misses      16912    16923      +11     
+ Partials     9550     9537      -13     
Files with missing lines Coverage Δ
lib/internal/modules/esm/module_map.js 98.48% <100.00%> (+0.01%) ⬆️

... and 47 files with indirect coverage changes

🚀 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants