chakra-core / chakra-core/ChakraCore
Spreading arrays is very slow compared to equivalent for-loop
Open
Performance
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Assuming `orig` is a standard gapless array with no custom behavior, the following:
```js
let dolly = [ ...orig ];
```
is approximately three times slower than
```js
let dolly = [];
for (let i = 0; i < orig.length; ++i) {
dolly[i] = orig[i];
}
```
Contributor guide
Assessment
This issue has not been assessed yet.