util,assert: improve comparison performance by BridgeAR · Pull Request #22258 · nodejs/node

@BridgeAR added the performance

Issues and PRs related to the performance of Node.js.

label

Aug 11, 2018

@BridgeAR BridgeAR added the assert

Issues and PRs related to the assert subsystem.

label

Aug 11, 2018

benjamingr

benjamingr

benjamingr

benjamingr

benjamingr

benjamingr

benjamingr

benjamingr

benjamingr

benjamingr

benjamingr

@benjamingr benjamingr added the semver-major

PRs that contain breaking changes and should be released in the next major version.

label

Aug 11, 2018

benjamingr

benjamingr

@BridgeAR BridgeAR removed the semver-major

PRs that contain breaking changes and should be released in the next major version.

label

Aug 11, 2018

@BridgeAR BridgeAR added the author ready

PRs that have at least one approval, no pending requests for changes, and a CI started.

label

Aug 11, 2018

@BridgeAR

This adds a smarter logic to compare object keys (including symbols)
and it also skips the object key comparison for (typed) arrays, if
possible.

Besides that it adds a fast path for empty objects, arrays, sets and
maps and fast paths for sets and maps with an unequal size.

On top of that a few functions are now safer to call by using
uncurryThis and by caching the actual function.

Overall, this is a significant performance boost for comparisons.

benjamingr

BridgeAR added a commit to BridgeAR/node that referenced this pull request

Aug 15, 2018
This adds a smarter logic to compare object keys (including symbols)
and it also skips the object key comparison for (typed) arrays, if
possible.

Besides that it adds a fast path for empty objects, arrays, sets and
maps and fast paths for sets and maps with an unequal size.

On top of that a few functions are now safer to call by using
uncurryThis and by caching the actual function.

Overall, this is a significant performance boost for comparisons.

PR-URL: nodejs#22258
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>

targos pushed a commit that referenced this pull request

Aug 19, 2018
This adds a smarter logic to compare object keys (including symbols)
and it also skips the object key comparison for (typed) arrays, if
possible.

Besides that it adds a fast path for empty objects, arrays, sets and
maps and fast paths for sets and maps with an unequal size.

On top of that a few functions are now safer to call by using
uncurryThis and by caching the actual function.

Overall, this is a significant performance boost for comparisons.

PR-URL: #22258
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>

targos pushed a commit that referenced this pull request

Sep 3, 2018
This adds a smarter logic to compare object keys (including symbols)
and it also skips the object key comparison for (typed) arrays, if
possible.

Besides that it adds a fast path for empty objects, arrays, sets and
maps and fast paths for sets and maps with an unequal size.

On top of that a few functions are now safer to call by using
uncurryThis and by caching the actual function.

Overall, this is a significant performance boost for comparisons.

PR-URL: #22258
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>

This was referenced

Sep 6, 2018

@BridgeAR BridgeAR deleted the improve-comparison-perf branch

January 20, 2020 11:36