[Webkit-unassigned] [Bug 280144] New: Deleting existing entry from Map/Set followed by re-adding is slower than in v8
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat Sep 21 22:43:12 PDT 2024
https://bugs.webkit.org/show_bug.cgi?id=280144
Bug ID: 280144
Summary: Deleting existing entry from Map/Set followed by
re-adding is slower than in v8
Product: WebKit
Version: WebKit Local Build
Hardware: Mac (Apple Silicon)
OS: macOS 14
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
Assignee: webkit-unassigned at lists.webkit.org
Reporter: dylan.conway567 at gmail.com
Example minified from https://github.com/oven-sh/bun/issues/14063
```
var map = new Set();
for (var i = 0; i < 1000; i++) {
for (var j = 0; j < 1000; j++) {
map.delete(j);
map.add(j);
}
}
```
Running this on an m1 max takes about 1 second with JSC. With v8 it takes about 100 milliseconds.
Switching the order of `delete` and `add`, or combining the loops into a single loop to 1000000 does not seem to repro this behavior.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240922/28d46848/attachment.htm>
More information about the webkit-unassigned
mailing list