← Back to Pull requests

esm: skip percent-decode copy for unescaped data URLs #67684

Merged
ychuhai merged 2 files (87 lines) on Nov 25, 2026 20:15 UTC
View on GitHub
ychuhai ychuhai commented on Nov 21, 2026 20:53 UTC
Author

Decoding a data: URL body copied every byte into a second array, even when there was nothing to decode. Skip when there's nothing, and take the index when there is a percent and use that to start the encoding.

benchmark/esm/data-url-processor.js (30 runs):

| size | plain | base64 |
|---|---|---|
| 64 | +30.23 % | +18.97 % |
| 1024 | +146.98 % | +27.66 % |
| 16384 | +1029.18 % | +24.37 % |
| 65536 | +1125.72 % | +27.25 % |

| size | percent | percent-tail | percent-mid | percent-at-64 |
|---|---|---|---|---|
| 64 | −2.02 % | −1.13 % | +4.29 % | +3.84 % |
| 1024 | +6.32 % | +113.54 % | +36.46 % | +6.23 % |
| 16384 | +11.23 %
| +804.23 % | +83.44 % | +11.17 % |
| 65536 | +15.25 %
| +968.96 % | +87.65 % ** | +7.13 % |

Diff: 87 lines (+78 / -9) across 2 files Reviewer: jasnell Review duration: 5722m
All Vouch review confidence checks passed
Residual risk 0.06 = Change Risk (0.31) × (1 − Review Confidence (0.81)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.31 · 87 lines diff across 2 files
0.31
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.72 · 5 substantive comment(s)
0.72
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
81%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.268
Real PR Conversation Timeline
9 items
nodejs-github-bot nodejs-github-bot commented on Nov 21, 2026 20:53 UTC
Bot

Review requested:

  • @nodejs/performance
  • github-actions[bot] github-actions[bot] commented on Nov 21, 2026 20:53 UTC
    Bot

    Welcome to Node.js, and thank you for your first contribution!

    Before review, please take a moment to read:

    the guide for first-time contributors
    the contribution and automation policies
    the pull request guide
    the AI use policy
    * the Code of Conduct

    Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

    codecov[bot] codecov[bot] commented on Nov 21, 2026 22:34 UTC
    Bot

    Codecov Report


    :white_check_mark: All modified and coverable lines are covered by tests.
    :white_check_mark: Project coverage is 90.60%. Comparing base (db671bb) to head (254ebd9).
    :warning: Report is 172 commits behind head on main.

    <details><summary>Additional details and impacted files</summary>

    @@            Coverage Diff             @@
    ##             main   #67684      +/-   ##
    ==========================================
    - Coverage   90.71%   90.60%   -0.12%     
    ==========================================
      Files         801      801              
      Lines      280917   281107     +190     
      Branches    54237    54269      +32     
    ==========================================
    - Hits       254832   254691     -141     
    - Misses      16253    16601     +348     
    + Partials     9832     9815      -17     
    

    | Files with missing lines | Coverage Δ | |
    |---|---|---|
    | lib/internal/data\_url.js | 100.00% <100.00%> (ø) | |

    ... and 69 files with indirect coverage changes
    </details>
    <details><summary> :rocket: New features to boost your workflow: </summary>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

  • </details>

    jasnell jasnell approved these changes on Nov 22, 2026 19:55 UTC
    Approved Reviewer

    Approved these changes.

    gurgunday gurgunday approved these changes on Nov 22, 2026 20:16 UTC
    Approved Reviewer

    lgtm

    nice!

    ychuhai ychuhai commented on Nov 25, 2026 14:52 UTC
    Author

    @gurgunday @jasnell hey 👋
    I believe this PR is ready to merge. Could you add the commit-queue label?

    nodejs-github-bot nodejs-github-bot commented on Nov 25, 2026 20:16 UTC
    Bot

    Landed in da97d87f9ab4fe48518a7dac9db7efccd36e2e76

    Reviewers
    Assignees
    ychuhai ychuhai
    Labels
    risk: low confidence: 81.4% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 31.2% (LOW) · Higher = larger blast radius
    31.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 81.4% · Lower = rushed or shallow review
    81.4%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 5.8% · Safe to merge
    5.8%
    Repository