For static QualifiedNames, precompute the Bloom filter. [chromium/src : main]

0 views
Skip to first unread message

Ian Kilpatrick (Gerrit)

unread,
Apr 20, 2026, 8:24:47 AM (7 days ago) Apr 20
to Steinar H Gunderson, Menard, Alexis, Kentaro Hara, (Julie)Jeongeun Kim, Kevin Babbitt, Raphael Kubo da Costa, chrom...@appspot.gserviceaccount.com, chromium...@chromium.org, abigailbk...@google.com, apavlo...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Steinar H Gunderson

Ian Kilpatrick voted and added 1 comment

Votes added by Ian Kilpatrick

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Ian Kilpatrick . resolved

nice!

Open in Gerrit

Related details

Attention is currently required from:
  • Steinar H Gunderson
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Icb83bef991945175aa13645eb1603f3b98397546
Gerrit-Change-Number: 7766594
Gerrit-PatchSet: 7
Gerrit-Owner: Steinar H Gunderson <se...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Steinar H Gunderson <se...@chromium.org>
Gerrit-Comment-Date: Mon, 20 Apr 2026 12:24:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Steinar H Gunderson (Gerrit)

unread,
Apr 20, 2026, 8:28:56 AM (7 days ago) Apr 20
to Ian Kilpatrick, Menard, Alexis, Kentaro Hara, (Julie)Jeongeun Kim, Kevin Babbitt, Raphael Kubo da Costa, chrom...@appspot.gserviceaccount.com, chromium...@chromium.org, abigailbk...@google.com, apavlo...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org

Steinar H Gunderson added 1 comment

Patchset-level comments
Steinar H Gunderson . resolved

It seems there some not-built-by-default fuzzer that needs an adjustment due to the types changing; I'll try to get to it later today, but it's going to need a re-stamp after that.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Icb83bef991945175aa13645eb1603f3b98397546
Gerrit-Change-Number: 7766594
Gerrit-PatchSet: 7
Gerrit-Owner: Steinar H Gunderson <se...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Comment-Date: Mon, 20 Apr 2026 12:28:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
open
diffy

Steinar H Gunderson (Gerrit)

unread,
Apr 20, 2026, 11:52:26 AM (7 days ago) Apr 20
to Ian Kilpatrick, Menard, Alexis, Kentaro Hara, (Julie)Jeongeun Kim, Kevin Babbitt, Raphael Kubo da Costa, chrom...@appspot.gserviceaccount.com, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, abigailbk...@google.com, apavlo...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Ian Kilpatrick

Steinar H Gunderson voted and added 1 comment

Votes added by Steinar H Gunderson

Auto-Submit+1
Commit-Queue+1

1 comment

Patchset-level comments
Steinar H Gunderson . resolved

Should be good now, hopefully. Was just that fuzzer adjustment plus some helper constructors to convert.

Open in Gerrit

Related details

Attention is currently required from:
  • Ian Kilpatrick
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Icb83bef991945175aa13645eb1603f3b98397546
Gerrit-Change-Number: 7766594
Gerrit-PatchSet: 8
Gerrit-Owner: Steinar H Gunderson <se...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steinar H Gunderson <se...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Comment-Date: Mon, 20 Apr 2026 15:52:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Ian Kilpatrick (Gerrit)

unread,
Apr 20, 2026, 12:39:42 PM (7 days ago) Apr 20
to Steinar H Gunderson, Chromium LUCI CQ, Menard, Alexis, Kentaro Hara, (Julie)Jeongeun Kim, Kevin Babbitt, Raphael Kubo da Costa, chrom...@appspot.gserviceaccount.com, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, abigailbk...@google.com, apavlo...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Steinar H Gunderson

Ian Kilpatrick voted

Code-Review+1
Commit-Queue+2
Open in Gerrit

Related details

Attention is currently required from:
  • Steinar H Gunderson
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Icb83bef991945175aa13645eb1603f3b98397546
Gerrit-Change-Number: 7766594
Gerrit-PatchSet: 8
Gerrit-Owner: Steinar H Gunderson <se...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steinar H Gunderson <se...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Steinar H Gunderson <se...@chromium.org>
Gerrit-Comment-Date: Mon, 20 Apr 2026 16:39:35 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Chromium LUCI CQ (Gerrit)

unread,
Apr 20, 2026, 12:53:42 PM (7 days ago) Apr 20
to Steinar H Gunderson, Ian Kilpatrick, Akihiro Ota, Menard, Alexis, Kentaro Hara, (Julie)Jeongeun Kim, Kevin Babbitt, Raphael Kubo da Costa, chrom...@appspot.gserviceaccount.com, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, abigailbk...@google.com, apavlo...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org

Chromium LUCI CQ submitted the change

Change information

Commit message:
For static QualifiedNames, precompute the Bloom filter.

If the name is known in advance, e.g. xml_names::kLangAttr, there's no
point in dynamically trying to call LocalNameUpper() and meticulously
putting together the bits of a Bloom filter; we can just store those 32
bits directly along the QualifiedName. This reduces the code size for
calling FastHasAttribute() and related code against these known names.
(The APK size bot claims a small increase for unclear reasons, but a
large reduction on arm64, and we also wee a significant reduction just
building the binaries locally on x86-64 Linux.)

It would be even better to just have a compile-time constant
instead of loading it from RAM, but we don't have that kind of ambition
in this patch; it would require constexpr rapidhash, at the very least.

Note that HTMLQualifiedName (and also SVGQualifiedName etc.), which is
mostly a simple alias to increase type safety, now inherits from
HTMLQualifiedNameWithHash, since there's no point in having a variant
of these without the hash.

We currently hard-code an assumption that Element::TinyBloomFilter
is uint32_t, in order to not pull element.h into qualified_name.h.

Certain benchmarks look unfairly good with this presumably since
we move the work of creating the uppercased LocalName string to
the process initialization instead of the actual parse time.
It _is_ faster to do it once on a static buffer like we do here,
but it seems unlikely to actually speed up e.g. CSS parsing by 10%,
like the Search microbenchmark would suggest. To counteract this,
we run the style perftest with --gtest_repeat=10 so that also the
old version gets to do most of its runs using a warmed-up string
pool; yet, we get a small benefit in parsing.

Style perftest (Zen 3, LTO but no PGO):

Parse (µs) Before After Perf 95% CI (BCa)
=================== ========= ========= ======= =================
ECommerce 999 993 +0.6% [ -0.0%, +1.4%]
Encyclopedia 5405 5372 +0.6% [ +0.2%, +1.1%]
Extension 635 645 -1.5% [ -2.4%, -0.6%]
News 5919 5867 +0.9% [ +0.4%, +1.4%]
Search 3760 3697 +1.7% [ +0.8%, +3.1%]
Social1 10712 10651 +0.6% [ +0.1%, +1.0%]
Social2 472 465 +1.4% [ +0.6%, +2.2%]
Sports 41381 41007 +0.9% [ +0.3%, +1.6%]
Video 24636 24398 +1.0% [ -1.1%, +3.1%]
Geometric mean +0.7% [ +0.3%, +1.1%]

Speedometer3 is a bit up and down, but more up than down and those
that are down are just barely statistically significant
(M1 Pinpoint, lower is better, significant results at 99% CI only):

Charts-observable-plot [ +0.1%, +0.8%]
TodoMVC-WebComponents [ +0.1%, +0.8%]
NewsSite-Next [ +0.0%, +0.3%]
TodoMVC-JavaScript-ES5 [ -2.3%, -0.4%]
TodoMVC-JavaScript-ES6-Webpack-Complex-DOM [ -1.4%, -0.6%]
Change-Id: Icb83bef991945175aa13645eb1603f3b98397546
Reviewed-by: Ian Kilpatrick <ikilp...@chromium.org>
Auto-Submit: Steinar H Gunderson <se...@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilp...@chromium.org>
Commit-Queue: Steinar H Gunderson <se...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1617562}
Files:
  • M third_party/blink/renderer/build/scripts/templates/make_qualified_names.cc.tmpl
  • M third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl
  • M third_party/blink/renderer/core/dom/element.h
  • M third_party/blink/renderer/core/dom/qualified_name.cc
  • M third_party/blink/renderer/core/dom/qualified_name.h
  • M third_party/blink/renderer/core/testing/fuzztest_utils/aria_domains.cc
Change size: M
Delta: 6 files changed, 91 insertions(+), 17 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Ian Kilpatrick
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Icb83bef991945175aa13645eb1603f3b98397546
Gerrit-Change-Number: 7766594
Gerrit-PatchSet: 9
Gerrit-Owner: Steinar H Gunderson <se...@chromium.org>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steinar H Gunderson <se...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages