Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b2bcb5ab9983735af83731aa5eb5fd8ada3f8f87
      
https://github.com/WebKit/WebKit/commit/b2bcb5ab9983735af83731aa5eb5fd8ada3f8f87
  Author: Chris Dumez <[email protected]>
  Date:   2026-04-09 (Thu, 09 Apr 2026)

  Changed paths:
    M Source/WebCore/dom/make_names.pl

  Log Message:
  -----------
  Collapse single-case switch chains into prefix comparisons in generated 
NodeName.cpp
https://bugs.webkit.org/show_bug.cgi?id=311785

Reviewed by Darin Adler.

When multiple names share a long common prefix (e.g. vert-origin-x / 
vert-origin-y),
the generator was emitting one nested switch per shared character — up to 12 
levels
deep — instead of a single compareCharacters() or WTF::equal() call for the 
shared
prefix. Detect common prefixes and emit a single comparison before recursing.

This did not show as an obvious progression on Speedometer (very close to noise
level) but it is theoretically more efficient and results in simpler / more 
concise
code so I think we should do it.

* Source/WebCore/dom/make_names.pl:
(computeCommonPrefixLength):
(printPrefixCheck):
(generateFindNameForLength):
(generateFindBody):

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



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

Reply via email to