mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Optimize array destructuring assignment for builtin iterators
...by avoiding `{ value, done }` iterator result value allocation. This
change applies the same otimization 81b6a11
added for `for..in` and
`for..of`.
Makes following micro benchmark go 22% faster on my computer:
```js
function f() {
const arr = [];
for (let i = 0; i < 10_000_000; i++) {
arr.push([i]);
}
let sum = 0;
for (let [i] of arr) {
sum += i;
}
}
f();
```
This commit is contained in:
parent
295b78f7d3
commit
60bd5012fe
Notes:
github-actions[bot]
2025-05-01 13:58:54 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 60bd5012fe
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4544
4 changed files with 11 additions and 15 deletions
|
@ -51,7 +51,6 @@
|
|||
O(EnterObjectEnvironment) \
|
||||
O(EnterUnwindContext) \
|
||||
O(Exp) \
|
||||
O(ForOfNext) \
|
||||
O(GetById) \
|
||||
O(GetByIdWithThis) \
|
||||
O(GetByValue) \
|
||||
|
@ -81,6 +80,7 @@
|
|||
O(InstanceOf) \
|
||||
O(IteratorClose) \
|
||||
O(IteratorNext) \
|
||||
O(IteratorNextUnpack) \
|
||||
O(IteratorToArray) \
|
||||
O(Jump) \
|
||||
O(JumpFalse) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue