Bug 327110
| Summary: | [CMake] Prewarm Swift modules on iOS and share them between targets | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | zak ridouh <zakr> |
| Component: | CMake | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
zak ridouh
Pull request: https://github.com/WebKit/WebKit/pull/76622
Radar WebKit Bug Importer
<rdar://problem/189721371>
EWS
Committed 328891@main (d2db4e816268): <https://commits.webkit.org/328891@main>
Reviewed commits have been landed. Closing PR #76622 and removing active labels.