RESOLVED FIXED 273568
Avoid copying FontPalette and FontVariantAlternates
https://bugs.webkit.org/show_bug.cgi?id=273568
Summary Avoid copying FontPalette and FontVariantAlternates
Brent Fulgham
Reported 2024-05-01 13:10:33 PDT
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
Radar WebKit Bug Importer
Comment 1 2024-05-01 13:10:48 PDT
Brent Fulgham
Comment 2 2024-05-01 15:05:42 PDT
(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
Comment 3 2024-05-01 15:12:21 PDT
Brent Fulgham
Comment 4 2024-05-02 09:43:50 PDT
(3) and (4) are too small to have value in passing by reference, so we will leave those as-is.
EWS
Comment 5 2024-05-03 17:21:33 PDT
Committed 278351@main (371cab863ee8): <https://commits.webkit.org/278351@main> Reviewed commits have been landed. Closing PR #28009 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.