[Bug]: isEqual with large Float64Arrays is slow
Version
29.7.0
Steps to reproduce
- Clone my repo https://github.com/akeating/jest-expect-isequal-perf.git
npm installnpm 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
Thanks for the great reproduction 👍
I've got a fix for this in https://github.com/jestjs/jest/pull/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
First step https://github.com/jestjs/jest/releases/tag/v30.0.0-alpha.6
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.
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.
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.
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.