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

update benchmarking #29

Merged
merged 3 commits into from
Nov 6, 2024
Merged

update benchmarking #29

merged 3 commits into from
Nov 6, 2024

Conversation

jeremy-daley-kr
Copy link
Contributor

Having followed a @testing-library/dom dependency trail to this update:
A11yance/aria-query#497

...it had me wondering how much of a performance improvement was gained between deep-equal to dequal. This PR just extends/updates current benchmarking to more easily get a conclusion on that... and wow! Looks pretty monumental unless I'm just simply doing something wrong. The load time of deep-equal alone is pretty far up there 😬

Load times:
assert: 0.334ms
util: 0.013ms
deep-equal: 72.528ms
fast-deep-equal: 0.925ms
lodash/isequal: 42.448ms
nano-equal: 0.801ms
dequal: 0.775ms
dequal/lite: 0.4ms

(basic) Validation: 
  ✔ assert.deepStrictEqual
  ✔ util.isDeepStrictEqual
  ✔ deep-equal
  ✔ fast-deep-equal
  ✔ lodash.isEqual
  ✔ nano-equal
  ✔ dequal/lite
  ✔ dequal

(basic) Benchmark: 
  assert.deepStrictEqual x 438,026 ops/sec ±6.23% (89 runs sampled)
  util.isDeepStrictEqual x 473,501 ops/sec ±2.66% (93 runs sampled)
  deep-equal             x 931 ops/sec ±0.70% (92 runs sampled)
  fast-deep-equal        x 1,872,682 ops/sec ±2.43% (91 runs sampled)
  lodash.isEqual         x 497,643 ops/sec ±0.66% (99 runs sampled)
  nano-equal             x 1,340,688 ops/sec ±0.72% (96 runs sampled)
  dequal/lite            x 2,169,654 ops/sec ±1.70% (95 runs sampled)
  dequal                 x 2,177,626 ops/sec ±0.41% (94 runs sampled)

(complex) Validation: 
  ✔ assert.deepStrictEqual
  ✔ util.isDeepStrictEqual
  ✔ deep-equal
  ✔ lodash.isEqual
  ✔ dequal

(complex) Benchmark: 
  assert.deepStrictEqual x 190,108 ops/sec ±1.19% (94 runs sampled)
  util.isDeepStrictEqual x 182,574 ops/sec ±7.89% (96 runs sampled)
  deep-equal             x 344 ops/sec ±1.37% (89 runs sampled)
  lodash.isEqual         x 94,137 ops/sec ±1.42% (94 runs sampled)
  dequal                 x 659,669 ops/sec ±0.80% (99 runs sampled)

@lukeed
Copy link
Owner

lukeed commented Nov 6, 2024

Yes, it's huge & slow. It's the Ever Given of deep equality libs.

Thanks for PR but, all this stuff goes inside bench/package.json, not the root.

@jeremy-daley-kr
Copy link
Contributor Author

Ah boo. My bad. That would explain a lot. Not sure how I missed that.

@jeremy-daley-kr
Copy link
Contributor Author

@lukeed Not sure if you're on a case-insensitive volume, but lodash/isequal doesn't work for me without a case update to lodash/isEqual.

@lukeed lukeed merged commit 37c21f6 into lukeed:master Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants