-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Milestone
Description
Bug Report
π Search Terms
__spreadArray performance benchmarking
π Version & Regression Information
- This changed between versions 4.1 and 4.2
β― Playground Link
CodeSandbox with benchmarks
Playground link with configuration example
π» Code
__spreadArray(__spreadArray([], arr1), arr2)
// vs.
__spreadArrays(arr1, arr2)π Actual behavior
Starting from 4.2, occurences of __spreadArrays are replaced with multiple calls to __spreadArray. The change fixes side effects in the polyfill (#32959).
| Function | Browser | Arrays | Elements per Array | Runs | Mean time in ms | Slowdown |
|---|---|---|---|---|---|---|
| __spreadArrays | Chromium 90 | 1 | (numbers) 1000000 | 100 | 2.32 | |
| __spreadArray | Chromium 90 | 1 | (numbers) 1000000 | 100 | 10.29 | 4.43 |
| __spreadArrays | Chromium 90 | 2 | (numbers) 1000000 | 100 | 4.35 | |
| __spreadArray | Chromium 90 | 2 | (numbers) 1000000 | 100 | 25.4 | 5.83 |
| __spreadArrays | Chromium 90 | 2 | (objects) 1000000 | 100 | 4.82 | |
| __spreadArray | Chromium 90 | 2 | (objects) 1000000 | 100 | 68.1 | 14.10 |
π Expected behavior
No or moderate performance impact.
Metadata
Metadata
Assignees
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.