[webkit-changes] [WebKit/WebKit] 6f6701: [WebCore] Use fast bitset iteration for Style Buil...

Yusuke Suzuki noreply at github.com
Mon Mar 18 10:42:00 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6f670174ddc808f8b33835f906a779b27236e8a4
      https://github.com/WebKit/WebKit/commit/6f670174ddc808f8b33835f906a779b27236e8a4
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2024-03-18 (Mon, 18 Mar 2024)

  Changed paths:
    M Source/WTF/wtf/BitSet.h
    M Source/WebCore/style/PropertyCascade.cpp
    M Source/WebCore/style/PropertyCascade.h
    M Source/WebCore/style/StyleBuilder.cpp
    M Tools/TestWebKitAPI/Tests/WTF/BitSet.cpp

  Log Message:
  -----------
  [WebCore] Use fast bitset iteration for Style Builder::applyPropertiesImpl
https://bugs.webkit.org/show_bug.cgi?id=271100
rdar://124722402

Reviewed by Antti Koivisto.

While top-priority / high-priority CSS properties are limited, more than 300 low-priority CSS properties exist.
And we are doing very naive iteration for that in Builder::applyPropertiesImpl. Given that only low-priority CSS properties
are huge and it is placed at the end of bitset, let's just use super fast bitset iteration instead of doing naive loop.

* Source/WTF/wtf/BitSet.h:
(WTF::WordType>::forEachSetBit const):
* Source/WebCore/style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::set):
* Source/WebCore/style/PropertyCascade.h:
(WebCore::Style::PropertyCascade::isEmpty const):
(WebCore::Style::PropertyCascade::propertyIsPresent):
(WebCore::Style::PropertyCascade::propertyIsPresent const):
(WebCore::Style::PropertyCascade::hasNormalProperty const):
* Source/WebCore/style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyPropertiesImpl):
* Tools/TestWebKitAPI/Tests/WTF/BitSet.cpp:
(TestWebKitAPI::testBitSetForEachSetBitWithStartIndex):
(TestWebKitAPI::TEST):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list