Title: [292341] branches/safari-613-branch/Source/WebCore/dom/EventListenerMap.h
- Revision
- 292341
- Author
- [email protected]
- Date
- 2022-04-04 14:56:17 -0700 (Mon, 04 Apr 2022)
Log Message
Cherry-pick r291866. rdar://91259284
Reduce EventListenerVector's minimum capacity from 16 to 2
https://bugs.webkit.org/show_bug.cgi?id=238374
Reviewed by Geoffrey Garen.
Reduce EventListenerVector's minimum capacity from 16 to 2 to save memory and get a small speedup on Speedometer.
Very few event listeners are registered for a given type in the common case so eagerly allocating enough memory for 16 is wasteful.
This is a confirmed 0.4% progression on Speedometer according to A/B bots.
dom/EventListenerMap.h:
Modified Paths
Diff
Modified: branches/safari-613-branch/Source/WebCore/dom/EventListenerMap.h (292340 => 292341)
--- branches/safari-613-branch/Source/WebCore/dom/EventListenerMap.h 2022-04-04 21:56:15 UTC (rev 292340)
+++ branches/safari-613-branch/Source/WebCore/dom/EventListenerMap.h 2022-04-04 21:56:17 UTC (rev 292341)
@@ -43,7 +43,7 @@
class EventTarget;
-using EventListenerVector = Vector<RefPtr<RegisteredEventListener>, 1>;
+using EventListenerVector = Vector<RefPtr<RegisteredEventListener>, 1, CrashOnOverflow, 2>;
class EventListenerMap {
public:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes