Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert: improve partialDeepStrictEqual #57509

Merged

Conversation

BridgeAR
Copy link
Member

This implements fast paths for typed arrays, array buffers and sets
and maps that contain only objects as keys.

@BridgeAR BridgeAR added the performance Issues and PRs related to the performance of Node.js. label Mar 16, 2025
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/performance

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Mar 16, 2025
@BridgeAR BridgeAR added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 16, 2025
@BridgeAR
Copy link
Member Author

BridgeAR commented Mar 16, 2025

Benchmark https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1683/

3 Stars only

assert/deepequal-buffer.js method='partial' arrayBuffer=0 strict=1 len=100 n=20000            ***     22.02 %       ±2.13%  ±2.85%  ±3.74%
assert/deepequal-buffer.js method='partial' arrayBuffer=0 strict=1 len=1000 n=20000           ***    244.64 %       ±7.91% ±10.65% ±14.13%
assert/deepequal-buffer.js method='partial' arrayBuffer=1 strict=1 len=100 n=20000            ***     30.51 %       ±2.65%  ±3.52%  ±4.59%
assert/deepequal-buffer.js method='partial' arrayBuffer=1 strict=1 len=1000 n=20000           ***    284.28 %      ±14.40% ±19.40% ±25.75%
assert/deepequal-set.js method='notDeepEqual_objectOnly' strict=0 len=500 n=1000              ***     -1.48 %       ±0.50%  ±0.67%  ±0.87%
assert/partial-deep-equal.js datasetName='arrayBuffers' extraProps=0 size=500 n=125           ***     96.15 %       ±1.55%  ±2.07%  ±2.72%
assert/partial-deep-equal.js datasetName='dataViewArrayBuffers' extraProps=0 size=500 n=125   ***     88.60 %       ±1.64%  ±2.19%  ±2.87%
assert/partial-deep-equal.js datasetName='dataViewArrayBuffers' extraProps=1 size=500 n=125   ***     -1.42 %       ±0.77%  ±1.03%  ±1.34%
assert/partial-deep-equal.js datasetName='setsWithObjects' extraProps=0 size=500 n=125        ***      6.63 %       ±0.82%  ±1.09%  ±1.42%
assert/partial-deep-equal.js datasetName='typedArrays' extraProps=0 size=500 n=125            ***      3.02 %       ±0.55%  ±0.73%  ±0.96%
assert/partial-deep-equal.js datasetName='typedArrays' extraProps=1 size=500 n=125            ***     13.01 %       ±0.55%  ±0.73%  ±0.96%

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 16, 2025
@nodejs-github-bot

This comment was marked as outdated.

This implements fast paths for typed arrays, array buffers and sets
and maps that contain only objects as keys.
@BridgeAR BridgeAR force-pushed the improve-partial-typed-array-perf branch from c42ee7f to c15e13e Compare March 16, 2025 23:59
@nodejs-github-bot
Copy link
Collaborator

@BridgeAR BridgeAR added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. assert Issues and PRs related to the assert subsystem. benchmark Issues and PRs related to the benchmark subsystem. and removed util Issues and PRs related to the built-in util module. labels Mar 17, 2025
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.21%. Comparing base (0cfc471) to head (1cb080d).
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57509      +/-   ##
==========================================
- Coverage   90.21%   90.21%   -0.01%     
==========================================
  Files         629      629              
  Lines      184845   184845              
  Branches    36206    36211       +5     
==========================================
- Hits       166766   166756      -10     
- Misses      11024    11032       +8     
- Partials     7055     7057       +2     
Files with missing lines Coverage Δ
lib/internal/util/comparisons.js 99.63% <100.00%> (-0.37%) ⬇️

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

@BridgeAR BridgeAR added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. request-ci Add this label to start a Jenkins CI on a PR. labels Mar 17, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 17, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@BridgeAR BridgeAR added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 19, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 19, 2025
@nodejs-github-bot nodejs-github-bot merged commit 1fbe335 into nodejs:main Mar 19, 2025
62 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 1fbe335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert Issues and PRs related to the assert subsystem. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. benchmark Issues and PRs related to the benchmark subsystem. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. performance Issues and PRs related to the performance of Node.js.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants