[webkit-changes] [WebKit/WebKit] ad2147: EventListenerMap's m_entries vector wastes a lot o...

Simon Fraser noreply at github.com
Mon Feb 6 15:33:56 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ad21476ae97ea62b562ada8c4f9790943b7f835e
      https://github.com/WebKit/WebKit/commit/ad21476ae97ea62b562ada8c4f9790943b7f835e
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2023-02-06 (Mon, 06 Feb 2023)

  Changed paths:
    M Source/WebCore/dom/EventListenerMap.h

  Log Message:
  -----------
  EventListenerMap's m_entries vector wastes a lot of vector capacity
https://bugs.webkit.org/show_bug.cgi?id=251697
<rdar://problem/105010273>

Reviewed by Mark Lam.

EventListenerMap's vector wastes capacity, since it allocates 16 slots but uses on average 1.63 of them; most contain only 1.
So set the initial capacity to 4. This saves about 54K on nytimes.com. It measures as perf neutral on Speedometer.

* Source/WebCore/dom/EventListenerMap.h:

Canonical link: https://commits.webkit.org/259920@main




More information about the webkit-changes mailing list