Skip to content

lib: optimize internal Web IDL dictionaries - #65857

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

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.

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

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants