Bug 327110

Summary: [CMake] Prewarm Swift modules on iOS and share them between targets
Product: WebKit Reporter: zak ridouh <zakr>
Component: CMakeAssignee: zak ridouh <zakr>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

zak ridouh
Reported 2026-10-10 16:44:03 PDT
Only macOS WebKit has a Swift prewarm, so on iOS: - WebKit's swiftc builds its module dependencies itself, serially and on the critical path (about 390 modules; 63 s on a warm machine, 35 s of it for WebCore_Private.pcm). - The five app extensions compile one Swift file each with identical flags, and each builds the same 268 modules at the same time at the end of the build (about 1,200 CPU-seconds of duplicate work). On both platforms, WebKitSwift and _WebKit_SwiftUI differ only in -DHAVE_CONFIG_H, so they build separate copies of the same SDK modules. The macOS prewarm also copies WebKit's flags at configure time with get_target_property; on iOS that gets some of them out of order or mangled, so the prewarm would build modules WebKit doesn't reuse. And it writes WebKit's .swiftinterface files. With an iOS prewarm, one shared by the extensions, and one shared by WebKitSwift and _WebKit_SwiftUI (with the same importer flags), iOS WebKit's Swift module is no longer on the critical path, each extension's Swift compile takes about 4 s instead of 50 s, and WebKitSwift and _WebKit_SwiftUI take about half as long on both platforms.
Attachments
zak ridouh
Comment 1 2026-10-10 16:57:23 PDT
Radar WebKit Bug Importer
Comment 2 2026-10-10 16:57:31 PDT
EWS
Comment 3 2026-12-05 11:23:32 PST
Committed 328891@main (d2db4e816268): <https://commits.webkit.org/328891@main> Reviewed commits have been landed. Closing PR #76622 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.