Bug 186708 - CSSFontFace wastes 59KB of Vector capacity on nytimes.com
Summary: CSSFontFace wastes 59KB of Vector capacity on nytimes.com
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-15 15:10 PDT by Simon Fraser (smfr)
Modified: 2018-06-20 10:14 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.40 KB, patch)
2018-06-16 22:32 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2018-06-15 15:10:04 PDT
Tooling from bug 186698:

Wasted capacity: 59000 bytes (used 13320 of 72320 bytes, utilization: 18.42%) - 565 allocations
1   0x107377885 WTF::VectorBuffer<std::__1::unique_ptr<WebCore::CSSFontFaceSource, std::__1::default_delete<WebCore::CSSFontFaceSource> >, 0ul>::VectorBuffer()
2   0x107377865 WTF::Vector<std::__1::unique_ptr<WebCore::CSSFontFaceSource, std::__1::default_delete<WebCore::CSSFontFaceSource> >, 0ul, WTF::CrashOnOverflow, 16ul>::Vector()
3   0x10735c535 WTF::Vector<std::__1::unique_ptr<WebCore::CSSFontFaceSource, std::__1::default_delete<WebCore::CSSFontFaceSource> >, 0ul, WTF::CrashOnOverflow, 16ul>::Vector()
4   0x10735c2f1 WebCore::CSSFontFace::CSSFontFace(WebCore::CSSFontSelector*, WebCore::StyleRuleFontFace*, WebCore::FontFace*, bool)
5   0x10735c63e WebCore::CSSFontFace::CSSFontFace(WebCore::CSSFontSelector*, WebCore::StyleRuleFontFace*, WebCore::FontFace*, bool)
6   0x10736559c WebCore::CSSFontFace::create(WebCore::CSSFontSelector*, WebCore::StyleRuleFontFace*, WebCore::FontFace*, bool)
7   0x10736ccd1 WebCore::CSSFontSelector::addFontFaceRule(WebCore::StyleRuleFontFace&, bool)
8   0x10736c6c9 WebCore::CSSFontSelector::buildCompleted()
Comment 1 Radar WebKit Bug Importer 2018-06-15 15:10:27 PDT
<rdar://problem/41173766>
Comment 2 Simon Fraser (smfr) 2018-06-16 22:32:07 PDT
Created attachment 342906 [details]
Patch
Comment 3 Anders Carlsson 2018-06-17 08:57:42 PDT
Comment on attachment 342906 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=342906&action=review

> Source/WebCore/css/CSSFontFace.h:187
> +    Vector<std::unique_ptr<CSSFontFaceSource>, 0, CrashOnOverflow, 0> m_sources;

This declaration is really confusing, it's not at all clear what the zeroes mean.

I wonder if it could be made more clear by adding a template alias declaration to Vector.h.
Comment 4 WebKit Commit Bot 2018-06-20 10:14:04 PDT
Comment on attachment 342906 [details]
Patch

Clearing flags on attachment: 342906

Committed r233014: <https://trac.webkit.org/changeset/233014>
Comment 5 WebKit Commit Bot 2018-06-20 10:14:05 PDT
All reviewed patches have been landed.  Closing bug.