Unverified Commit 7e5f500c authored by Anna Henningsen's avatar Anna Henningsen
Browse files

assert: improve deepEqual perf for large input

Use a Map instead of an array for checking previously found
cyclic references.

This reduces complexity for an array-of-objects case from
O(n²) to O(n·log n).

Fixes: https://github.com/nodejs/node/issues/12842
PR-URL: https://github.com/nodejs/node/pull/12849


Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarJoyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarJeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: default avatarRefael Ackermann <refack@gmail.com>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
parent 3fd890a0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment