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

[Bug]: isEqual with large Float64Arrays is slow #15176

Closed
akeating opened this issue Jul 10, 2024 · 6 comments
Closed

[Bug]: isEqual with large Float64Arrays is slow #15176

akeating opened this issue Jul 10, 2024 · 6 comments

Comments

@akeating
Copy link

Version

29.7.0

Steps to reproduce

  1. Clone my repo https://github.com/akeating/jest-expect-isequal-perf.git
  2. npm install
  3. npm test

Expected behavior

expect.isEqual with large Float64Arrays performs inline with lodash at around 5ms

Actual behavior

expect.isEqual with large Float64Arrays takes around 600ms

Additional context

No response

Environment

System:
  OS: macOS 14.5
  CPU: (10) arm64 Apple M1 Pro
Binaries:
  Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
  Yarn: 4.0.2 - ~/.nvm/versions/node/v20.10.0/bin/yarn
  npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
  pnpm: 9.1.2 - ~/.nvm/versions/node/v20.10.0/bin/pnpm
  bun: 1.1.10 - /opt/homebrew/bin/bun
npmPackages:
  jest: ^29.7.0 => 29.7.0
@SimenB
Copy link
Member

SimenB commented Jul 11, 2024

Thanks for the great reproduction 👍

I've got a fix for this in #15178, but only when using toStrictEqual (although it also makes toEqual use 100m instead of 500ms). As mentioned there, it might make sense to properly support ArrayBuffer/TypedArray equality in toEqual as well

@SimenB
Copy link
Member

SimenB commented Aug 8, 2024

Copy link

github-actions bot commented Sep 7, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Sep 7, 2024
Copy link

github-actions bot commented Oct 7, 2024

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

1 similar comment
Copy link

github-actions bot commented Oct 7, 2024

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
Copy link

github-actions bot commented Nov 7, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants