Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9816b1440ae4ae7ef2be80ba086248d29e820aec
      
https://github.com/WebKit/WebKit/commit/9816b1440ae4ae7ef2be80ba086248d29e820aec
  Author: Geoffrey Garen <[email protected]>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M Source/WTF/Scripts/generate-unified-source-bundles.py
    M Source/WebCore/Sources.txt
    M Source/WebKit/Sources.txt
    M Source/WebKit/SourcesCocoa.txt
    M Source/WebKit/SourcesGTK.txt
    M Source/WebKitLegacy/SourcesCocoa.txt
    M Source/cmake/OptionsMac.cmake
    M Source/cmake/WebKitMacros.cmake

  Log Message:
  -----------
  [CMake][Mac] Jumbo unified builds with @cost weighting
https://bugs.webkit.org/show_bug.cgi?id=316219
rdar://178646839

Reviewed by Pascoe.

Speeds up clean build time by about 2 minutes (27.5%).

Raised the unified build member count from 8 to 128. (Up to 128 is
measurably profitable, and beyond that is not.)

To counter-act the potential increase in incremental build time, we
already have:
  * adaptive unified builds
  * tuned prefix headers

To that, this patch adds @cost annotation for particularly costly unified
build members. @cost is an optional annotation to indicate a file's wall
time cost to compile, relative to the median. It addresses the case where
a unified bundle contains many long pole files. It's not a regression for
an incremental build to wait on one long pole, but it is a regression for
it to wait on many.

I don't think we need a fancy system for keeping @cost always up to date.
If we ever see a long pole in the future, we can slap a new @cost on it.

All incremental build times after first touch (cold) are un-changed.
First touch (cold) times are mostly un-changed on average, but there are
some small losses:

┌────────────────────────────────────────────────────────────┬
│          First touch (cold) incremental build time         │
├───────────────────────────┬──────────┬──────────┬──────────┼
│        sub-target         │    N=8   │   N=128  │     Δ    │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ WebCoreJSBindings         │   10.3 s │    8.2 s │   −2.1 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ WebCoreRenderStyleInlines │    4.1 s │    2.0 s │   −2.0 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ JavaScriptCoreJIT         │    1.1 s │    1.9 s │   +0.7 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ WebKitNetworkProcess      │    4.1 s │    4.5 s │   +0.4 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ WebCoreStyle              │    4.4 s │    5.7 s │   +1.3 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ WebCore (platform/)       │    2.8 s │    4.8 s │   +2.0 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ WebCoreDOMAndRendering    │    4.4 s │    6.5 s │   +2.1 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ JavaScriptCore            │    1.1 s │    3.5 s │   +2.3 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ WebKitUIProcess           │    2.2 s │    3.0 s │   +0.7 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ WebKitShared              │    4.1 s │    6.9 s │   +2.9 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ WebKitGPUProcess          │    4.1 s │    5.2 s │   +1.1 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ WebKitWebProcess          │    4.7 s │    9.5 s │   +4.9 s │
├───────────────────────────┼──────────┼──────────┼──────────┼
│ WebCore (Modules/)        │    2.8 s │    8.7 s │   +5.9 s │
└───────────────────────────┴──────────┴──────────┴──────────┴

Source/cmake/WebKitMacros.cmake:
- Forward WEBKIT_MAX_BUNDLE_SIZE as --max-bundle-size

Source/cmake/OptionsMac.cmake:
- set WEBKIT_MAX_BUNDLE_SIZE 128 (Mac-only for now; other ports can opt
  in once we A/B test compile time and validate EWS)

* Source/WTF/Scripts/generate-unified-source-bundles.py:
(bundle_prefix_and_size_for_path):
(SourceFile.__init__):
(BundleManager.add_file): Added support for a file that costs greater
than implicit 1.

(parse_args):
* Source/WebCore/Sources.txt:
* Source/WebKit/Sources.txt:
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/SourcesGTK.txt:
* Source/WebKitLegacy/SourcesCocoa.txt: Added cost annotations.

* Source/cmake/OptionsMac.cmake: Set unified bundle member count to 128.
* Source/cmake/WebKitMacros.cmake:

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



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

Reply via email to