Bug 311831
| Summary: | Build time improvement: Use extern template instantiation for high-traffic mpark::variant instantiations | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> |
| Component: | New Bugs | Assignee: | Brent Fulgham <bfulgham> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Brent Fulgham
Reduce redundant template instantiation across translation units by adding explicit template instantiation for commonly used mpark::variant types in widely-included WebCore headers.
This reduces compile time by avoiding the repeated template expansions (which have to be culled at link time). Currently every translation unit does a template expansion of the variant machinery, which has to be removed at a later build step. Both operations add time to the build.
On my system, this current patch reduced build time by 5.4%.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/174419851>
Brent Fulgham
Pull request: https://github.com/WebKit/WebKit/pull/62367
Brent Fulgham
Results from my M4 MBP:
```
====================================================================================================
AGGREGATE CATEGORY COMPARISON (matched TUs only)
====================================================================================================
Frontend 12256.4s -> 12232.8s (-23.6s, -0.2%)
Backend 4271.6s -> 4273.3s (+1.7s, +0.0%)
ParseClass 4611.2s -> 4537.8s (-73.4s, -1.6%)
InstantiateFunction 12829.7s -> 12745.9s (-83.7s, -0.7%)
InstantiateClass 5116.3s -> 5150.7s (+34.4s, +0.7%)
PerformPendingInstantiations 2382.6s -> 2315.5s (-67.1s, -2.8%)
CodeGen Function 516.6s -> 537.4s (+20.8s, +4.0%)
OptFunction 1413.2s -> 1426.0s (+12.8s, +0.9%)
OptModule 2554.0s -> 2532.5s (-21.5s, -0.8%)
====================================================================================================
FINAL SUMMARY — build IMPROVED by 18.0s (0.8%)
====================================================================================================
Total compile time: 16674.0s -> 16655.9s (-18.0s, -0.8%)
Frontend -23.6s (-0.2%) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Backend +1.7s (+0.0%) >>
ParseClass -73.4s (-1.6%) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
InstantiateFunction -83.7s (-0.7%) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
InstantiateClass +34.4s (+0.7%) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
PerformPendingInstantiations -67.1s (-2.8%) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
CodeGen Function +20.8s (+4.0%) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
OptFunction +12.8s (+0.9%) >>>>>>>>>>>>>>>>>>>>>
OptModule -21.5s (-0.8%) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Template instantiations (net): -49.3s
time saved: -1266.0s (templates faster or removed)
time added: +1216.7s (templates slower or new)
```
Brent Fulgham
Note: The 5.4% was for a different patch. This small change only nets 0.8%.
EWS
Committed 311479@main (c69a763f29d8): <https://commits.webkit.org/311479@main>
Reviewed commits have been landed. Closing PR #62367 and removing active labels.