Bug 273568
| Summary: | Avoid copying FontPalette and FontVariantAlternates | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> |
| Component: | WebCore Misc. | 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 unnecessary copies in our font handling code:
(1) FontPalette is a struct containing an enum and an AtomString, and should be returned by const reference to avoid copying that string.
(2) FontVariantAlternatives is lightweight, containing only a `Markable`, but the `Markable` is holding a very heavy-weight object that contains Vectors of Strings, and Strings.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/127380343>
Brent Fulgham
(3) FontSelectionRequest contains two int16_t's and std::optional<int16_t>
(4) FontSelectionCapabilities contains three sub-objects, each holding multiple int16_t values, but always returns a computed copy so not easy to reduce copies.
Brent Fulgham
Pull request: https://github.com/WebKit/WebKit/pull/28009
Brent Fulgham
(3) and (4) are too small to have value in passing by reference, so we will leave those as-is.
EWS
Committed 278351@main (371cab863ee8): <https://commits.webkit.org/278351@main>
Reviewed commits have been landed. Closing PR #28009 and removing active labels.