Skip to content

assert,util: improve array comparison #57619

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

Closed

Conversation

BridgeAR
Copy link
Member

@BridgeAR BridgeAR commented Mar 25, 2025

Sparse arrays and arrays containing undefined are now compared faster using assert.deepStrictEqual() or util.isDeepStrictEqual().

Update: I added another commit that also improves the comparison performance for unequal numbers.

Local benchmark (more configurations and higher iterations to show that even regular arrays improve by ~1%. This should not matter for regular runs, so I kept the benchmark simpler in here):

                                                                                                                         confidence improvement accuracy (*)   (**)  (***)
assert/deepequal-simple-array-and-set.js method='deepEqual_Array' containsUndefined=0 strict=1 len=10000 n=4000                 ***      1.39 %       ±0.67% ±0.90% ±1.17%
assert/deepequal-simple-array-and-set.js method='deepEqual_Array' containsUndefined=1 strict=1 len=10000 n=4000                 ***     24.22 %       ±0.92% ±1.23% ±1.60%
assert/deepequal-simple-array-and-set.js method='deepEqual_Set' containsUndefined=0 strict=1 len=10000 n=4000                            1.41 %       ±1.71% ±2.28% ±2.98%
assert/deepequal-simple-array-and-set.js method='deepEqual_Set' containsUndefined=1 strict=1 len=10000 n=4000                            1.56 %       ±1.57% ±2.08% ±2.71%
assert/deepequal-simple-array-and-set.js method='deepEqual_sparseArray' containsUndefined=0 strict=1 len=10000 n=4000           ***     28.45 %       ±0.80% ±1.06% ±1.38%
assert/deepequal-simple-array-and-set.js method='deepEqual_sparseArray' containsUndefined=1 strict=1 len=10000 n=4000           ***     28.36 %       ±0.85% ±1.14% ±1.48%
assert/deepequal-simple-array-and-set.js method='notDeepEqual_Array' containsUndefined=0 strict=1 len=10000 n=4000                *      1.70 %       ±1.53% ±2.05% ±2.70%
assert/deepequal-simple-array-and-set.js method='notDeepEqual_Array' containsUndefined=1 strict=1 len=10000 n=4000              ***     23.54 %       ±0.95% ±1.26% ±1.64%
assert/deepequal-simple-array-and-set.js method='notDeepEqual_Set' containsUndefined=0 strict=1 len=10000 n=4000                        -1.20 %       ±1.35% ±1.80% ±2.36%
assert/deepequal-simple-array-and-set.js method='notDeepEqual_Set' containsUndefined=1 strict=1 len=10000 n=4000                         0.33 %       ±1.81% ±2.41% ±3.14%
assert/deepequal-simple-array-and-set.js method='notDeepEqual_sparseArray' containsUndefined=0 strict=1 len=10000 n=4000        ***     28.05 %       ±0.86% ±1.15% ±1.49%
assert/deepequal-simple-array-and-set.js method='notDeepEqual_sparseArray' containsUndefined=1 strict=1 len=10000 n=4000        ***     28.11 %       ±0.98% ±1.31% ±1.70%

Sparse arrays and arrays containing undefined are now compared faster
using assert.deepStrictEqual() or util.isDeepStrictEqual().
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/performance

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

codecov bot commented Mar 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.22%. Comparing base (a4f556f) to head (f46895a).
Report is 34 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57619      +/-   ##
==========================================
- Coverage   90.24%   90.22%   -0.02%     
==========================================
  Files         630      630              
  Lines      185129   185053      -76     
  Branches    36238    36214      -24     
==========================================
- Hits       167064   166960     -104     
- Misses      11045    11055      +10     
- Partials     7020     7038      +18     
Files with missing lines Coverage Δ
lib/internal/assert/myers_diff.js 89.26% <100.00%> (+0.06%) ⬆️
lib/internal/util/comparisons.js 99.63% <100.00%> (-0.01%) ⬇️

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

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's very surprising to me that checking undefined is faster, especially in the case of getters, but if the benchmarks say it is, so be it :-)

This improves the performance to compare unequal numbers while doing
a deep equal comparison. Comparing for NaN is faster by checking
`variable !== variable` than by using `Number.isNaN()`.
@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 28, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 1, 2025
@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 Apr 2, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Apr 2, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/57619
✔  Done loading data for nodejs/node/pull/57619
----------------------------------- PR info ------------------------------------
Title      assert,util: improve array comparison (#57619)
Author     Ruben Bridgewater <[email protected]> (@BridgeAR)
Branch     BridgeAR:improve-array-comparison-performance -> nodejs:main
Labels     assert, util, author ready, needs-ci, needs-benchmark-ci
Commits    2
 - assert,util: improve array comparison
 - assert,util: improve unequal number comparison performance
Committers 1
 - Ruben Bridgewater <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Tue, 25 Mar 2025 14:56:12 GMT
   ✔  Approvals: 8
   ✔  - Jordan Harband (@ljharb): https://github.com/nodejs/node/pull/57619#pullrequestreview-2715456471
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/57619#pullrequestreview-2714836677
   ✔  - Chemi Atlow (@atlowChemi): https://github.com/nodejs/node/pull/57619#pullrequestreview-2718565014
   ✔  - Colin Ihrig (@cjihrig): https://github.com/nodejs/node/pull/57619#pullrequestreview-2722582043
   ✔  - Edy Silva (@geeksilva97): https://github.com/nodejs/node/pull/57619#pullrequestreview-2722705971
   ✔  - Trivikram Kamat (@trivikr): https://github.com/nodejs/node/pull/57619#pullrequestreview-2727255507
   ✔  - Rafael Gonzaga (@RafaelGSS) (TSC): https://github.com/nodejs/node/pull/57619#pullrequestreview-2729765085
   ✔  - Benjamin Gruenbaum (@benjamingr) (TSC): https://github.com/nodejs/node/pull/57619#pullrequestreview-2735987939
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2025-04-02T11:46:18Z: https://ci.nodejs.org/job/node-test-pull-request/65970/
- Querying data for job/node-test-pull-request/65970/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 57619
From https://github.com/nodejs/node
 * branch                  refs/pull/57619/merge -> FETCH_HEAD
✔  Fetched commits as e1fabe4f5872..f46895a01ed5
--------------------------------------------------------------------------------
[main e54cd5b040] assert,util: improve array comparison
 Author: Ruben Bridgewater <[email protected]>
 Date: Tue Mar 25 15:27:50 2025 +0100
 3 files changed, 34 insertions(+), 26 deletions(-)
[main dbe975cfd0] assert,util: improve unequal number comparison performance
 Author: Ruben Bridgewater <[email protected]>
 Date: Wed Mar 26 01:00:49 2025 +0100
 1 file changed, 9 insertions(+), 5 deletions(-)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
Rebasing (2/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
assert,util: improve array comparison

Sparse arrays and arrays containing undefined are now compared faster
using assert.deepStrictEqual() or util.isDeepStrictEqual().

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>

[detached HEAD 41c81a6c43] assert,util: improve array comparison
Author: Ruben Bridgewater <[email protected]>
Date: Tue Mar 25 15:27:50 2025 +0100
3 files changed, 34 insertions(+), 26 deletions(-)
Rebasing (3/4)
Rebasing (4/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
assert,util: improve unequal number comparison performance

This improves the performance to compare unequal numbers while doing
a deep equal comparison. Comparing for NaN is faster by checking
variable !== variable than by using Number.isNaN().

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>

[detached HEAD c62784fdca] assert,util: improve unequal number comparison performance
Author: Ruben Bridgewater <[email protected]>
Date: Wed Mar 26 01:00:49 2025 +0100
1 file changed, 9 insertions(+), 5 deletions(-)
Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/14231662401

@BridgeAR BridgeAR added commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 2, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 2, 2025
@nodejs-github-bot
Copy link
Collaborator

Landed in 4abad07...657f818

nodejs-github-bot pushed a commit that referenced this pull request Apr 2, 2025
Sparse arrays and arrays containing undefined are now compared faster
using assert.deepStrictEqual() or util.isDeepStrictEqual().

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Apr 2, 2025
This improves the performance to compare unequal numbers while doing
a deep equal comparison. Comparing for NaN is faster by checking
`variable !== variable` than by using `Number.isNaN()`.

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
JonasBa pushed a commit to JonasBa/node that referenced this pull request Apr 11, 2025
Sparse arrays and arrays containing undefined are now compared faster
using assert.deepStrictEqual() or util.isDeepStrictEqual().

PR-URL: nodejs#57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
JonasBa pushed a commit to JonasBa/node that referenced this pull request Apr 11, 2025
This improves the performance to compare unequal numbers while doing
a deep equal comparison. Comparing for NaN is faster by checking
`variable !== variable` than by using `Number.isNaN()`.

PR-URL: nodejs#57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
Sparse arrays and arrays containing undefined are now compared faster
using assert.deepStrictEqual() or util.isDeepStrictEqual().

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
This improves the performance to compare unequal numbers while doing
a deep equal comparison. Comparing for NaN is faster by checking
`variable !== variable` than by using `Number.isNaN()`.

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
Sparse arrays and arrays containing undefined are now compared faster
using assert.deepStrictEqual() or util.isDeepStrictEqual().

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
This improves the performance to compare unequal numbers while doing
a deep equal comparison. Comparing for NaN is faster by checking
`variable !== variable` than by using `Number.isNaN()`.

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
aduh95 pushed a commit that referenced this pull request May 6, 2025
Sparse arrays and arrays containing undefined are now compared faster
using assert.deepStrictEqual() or util.isDeepStrictEqual().

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
aduh95 pushed a commit that referenced this pull request May 6, 2025
This improves the performance to compare unequal numbers while doing
a deep equal comparison. Comparing for NaN is faster by checking
`variable !== variable` than by using `Number.isNaN()`.

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
Sparse arrays and arrays containing undefined are now compared faster
using assert.deepStrictEqual() or util.isDeepStrictEqual().

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
This improves the performance to compare unequal numbers while doing
a deep equal comparison. Comparing for NaN is faster by checking
`variable !== variable` than by using `Number.isNaN()`.

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
Sparse arrays and arrays containing undefined are now compared faster
using assert.deepStrictEqual() or util.isDeepStrictEqual().

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
This improves the performance to compare unequal numbers while doing
a deep equal comparison. Comparing for NaN is faster by checking
`variable !== variable` than by using `Number.isNaN()`.

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
Sparse arrays and arrays containing undefined are now compared faster
using assert.deepStrictEqual() or util.isDeepStrictEqual().

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
This improves the performance to compare unequal numbers while doing
a deep equal comparison. Comparing for NaN is faster by checking
`variable !== variable` than by using `Number.isNaN()`.

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
aduh95 pushed a commit that referenced this pull request May 19, 2025
Sparse arrays and arrays containing undefined are now compared faster
using assert.deepStrictEqual() or util.isDeepStrictEqual().

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
aduh95 pushed a commit that referenced this pull request May 19, 2025
This improves the performance to compare unequal numbers while doing
a deep equal comparison. Comparing for NaN is faster by checking
`variable !== variable` than by using `Number.isNaN()`.

PR-URL: #57619
Reviewed-By: Jordan Harband <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Edy Silva <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
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. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. needs-benchmark-ci PR that need a benchmark CI run. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.