Skip to content

lib: optimize internal Web IDL dictionaries - #65857

Open
panva wants to merge 1 commit into
nodejs:mainfrom
panva:optimize-webidl-dictionaries
Open

lib: optimize internal Web IDL dictionaries#65857
panva wants to merge 1 commit into
nodejs:mainfrom
panva:optimize-webidl-dictionaries

Conversation

@panva

@panva panva commented Sep 6, 2026

Copy link
Copy Markdown
Member

Flatten dictionary members at construction while preserving inheritance order. Skip member scans for nullish inputs without defaults or required members, and define own descriptor properties to avoid inherited setters.

Flatten dictionary members at construction while preserving inheritance
order. Skip member scans for nullish inputs without defaults or required
members, and define own descriptor properties to avoid inherited
setters.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Benchmark GHA (misc / webcrypto-webidl): https://github.com/nodejs/node/actions/runs/34041429199

Results

[!WARNING]
Do not take GHA benchmark results as face value, always confirm them
using a dedicated machine, e.g. Jenkins CI.

Benchmark results:

                                                                           confidence improvement accuracy (*)   (**)   (***)
misc/webcrypto-webidl.js n=1000000 op='normalizeAlgorithm-dict'                            2.94 %       ±4.86% ±6.41%  ±8.23%
misc/webcrypto-webidl.js n=1000000 op='normalizeAlgorithm-string'                          2.91 %       ±4.59% ±6.05%  ±7.77%
misc/webcrypto-webidl.js n=1000000 op='webidl-algorithm-identifier-object'                 0.45 %       ±6.31% ±8.32% ±10.67%
misc/webcrypto-webidl.js n=1000000 op='webidl-algorithm-identifier-string'                 0.68 %       ±5.78% ±7.62%  ±9.77%
misc/webcrypto-webidl.js n=1000000 op='webidl-dict-enforce-range'                          1.40 %       ±5.66% ±7.46%  ±9.57%
misc/webcrypto-webidl.js n=1000000 op='webidl-dict-ensure-sha'                             1.26 %       ±5.27% ±6.95%  ±8.91%
misc/webcrypto-webidl.js n=1000000 op='webidl-dict-null'                          ***     46.44 %       ±5.52% ±7.27%  ±9.34%
misc/webcrypto-webidl.js n=1000000 op='webidl-dict'                                 *      5.36 %       ±5.09% ±6.71%  ±8.61%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 8 comparisons, you can thus
expect the following amount of false-positive results:
  0.40 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.08 false positives, when considering a   1% risk acceptance (**, ***),
  0.01 false positives, when considering a 0.1% risk acceptance (***)

[!WARNING]
Do not take GHA benchmark results as face value, always confirm them
using a dedicated machine, e.g. Jenkins CI.

@panva
panva marked this pull request as ready for review September 6, 2026 17:28
@panva

panva commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

cc @nodejs/web-standards

@panva panva added the web-standards Issues and PRs related to web-platform APIs and standards compliance. label Sep 6, 2026
@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.19%. Comparing base (7991140) to head (f17343c).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65857      +/-   ##
==========================================
- Coverage   90.19%   90.19%   -0.01%     
==========================================
  Files         771      771              
  Lines      264622   264619       -3     
  Branches    50223    50230       +7     
==========================================
- Hits       238663   238660       -3     
+ Misses      16965    16954      -11     
- Partials     8994     9005      +11     
Files with missing lines Coverage Δ
lib/internal/webidl.js 100.00% <100.00%> (ø)

... and 30 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.

@panva panva added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Sep 6, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 6, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@aduh95 aduh95 added the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. needs-ci PRs that need a full CI run. web-standards Issues and PRs related to web-platform APIs and standards compliance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants