Closed dalcde closed 4 years ago
:+1:
tape
is meant to work in a browser, and using assert
means we have to use the browserify shim, which isn't anywhere near as close to as correct as deep-equal
is.
Dependency count is irrelevant, and performance is exceedingly less important than correctness. I'm strongly opposed to this change.
This is a good point, the benefits of native assert
in node 12/14 are useless when we really need to npm install assert
and require('assert/')
You should open an issue on the deep-equal
package to port nodejs improvements to the deep-equal
package directly.
That's already been done; deep-equal v2, which is included in tape v5, should match latest node as much as is possible.
The issue with assert/
is that it does not support old enough node/browser engines, whereas deep-equal (like tape) supports everything.
I think you should diverge from doing it the NodeJS way... Use a alternative package like fast-deep-equal instead.
deep-equal is really really slow and too large! just look at it: https://npmgraph.js.org/?q=deep-equal it's a insane 2mb for something that could just be turned into a few bytes
This is the reason why i'm looking at other alternatives or simply don't use tape at all...
I have no interest in diverging from doing it the node way, as long as node exists.
It can't be done correctly in a few bytes - fast-deep-equal is not robust. If you wish to use different alternatives, go for it, but tape (as well as the other hundreds of packages I maintain) will NEVER prioritize speed or disk space over correctness, since correctness is more important than all other considerations.
According to the benchmarks of https://gist.github.com/substack/2790507#gistcomment-3100007 , using
assert.deepEqual
andutil.isDeepStrictEqual
is way, way faster than thedeep-equal
library. The results in the comment indicatesdeep-equal
is faster only in 1 out of 9 situations, but running the script on node 14.8.0 and 10.19.0 both indicate thatdeep-equal
is in fact slower in all situations.Further,
deep-equal
has a fairly large dependency tree; in terms of package count, removingdeep-equal
will remove 23 out of 59 dependencies of tape.