Bug 254490

Summary: Serialising web fonts duplicates the font custom data in the GPUP
Product: WebKit Reporter: Matt Woodrow <mattwoodrow>
Component: TextAssignee: Matt Woodrow <mattwoodrow>
Status: RESOLVED FIXED    
Severity: Normal CC: Hironori.Fujii, mmaxfield, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=254774
https://bugs.webkit.org/show_bug.cgi?id=254708
Bug Depends on:    
Bug Blocks: 268233    

Description Matt Woodrow 2023-03-26 16:55:32 PDT
In the Web Process, all Font instances from the same web font share the same underlying font data (via Font::CreationData).

When we serialise fonts to the GPUP we serialise the font data each time, resulting in extra memory usage and time spent parsing the data each time.

<rdar://106965215>
Comment 1 Matt Woodrow 2023-03-26 17:17:58 PDT
Pull request: https://github.com/WebKit/WebKit/pull/11987
Comment 2 Matt Woodrow 2023-03-28 16:47:37 PDT
Pull request: https://github.com/apple/WebKit/pull/502
Comment 3 EWS 2023-03-29 01:06:17 PDT
Committed 262263@main (b917345920e9): <https://commits.webkit.org/262263@main>

Reviewed commits have been landed. Closing PR #11987 and removing active labels.
Comment 4 Fujii Hironori 2023-03-30 13:44:22 PDT
Regressed: Bug 254708 – REGRESSION(262263@main) [Win] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) in font tests
Comment 5 Simon Fraser (smfr) 2023-03-30 14:58:59 PDT
Right; reverting via bug 254774.
Comment 6 Matt Woodrow 2023-03-30 23:26:56 PDT
Re-opening for pull request https://github.com/WebKit/WebKit/pull/12221
Comment 7 EWS 2023-03-31 12:37:34 PDT
Committed 262435@main (403125028b31): <https://commits.webkit.org/262435@main>

Reviewed commits have been landed. Closing PR #12221 and removing active labels.