Changeset 275609 in webkit


Ignore:
Timestamp:
Apr 7, 2021 9:56:14 AM (3 years ago)
Author:
Simon Fraser
Message:

Wasted vector capacity in StyleSheetContents
https://bugs.webkit.org/show_bug.cgi?id=224250

Reviewed by Darin Adler.

Call shrinkToFit() on the StyleSheetContents created in CSSParserImpl::parseStyleSheet()
in order to shrink m_importRules and m_childRules, which can waste about 100KB on
youtube.com.

  • css/parser/CSSParserImpl.cpp:

(WebCore::CSSParserImpl::parseStyleSheet):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r275607 r275609  
     12021-04-07  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Wasted vector capacity in StyleSheetContents
     4        https://bugs.webkit.org/show_bug.cgi?id=224250
     5
     6        Reviewed by Darin Adler.
     7
     8        Call shrinkToFit() on the StyleSheetContents created in CSSParserImpl::parseStyleSheet()
     9        in order to shrink m_importRules and m_childRules, which can waste about 100KB on
     10        youtube.com.
     11
     12        * css/parser/CSSParserImpl.cpp:
     13        (WebCore::CSSParserImpl::parseStyleSheet):
     14
    1152021-04-07  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/Source/WebCore/css/parser/CSSParserImpl.cpp

    r275479 r275609  
    252252    });
    253253    styleSheet->setHasSyntacticallyValidCSSHeader(firstRuleValid);
     254    styleSheet->shrinkToFit();
    254255    parser.adoptTokenizerEscapedStrings();
    255256}
Note: See TracChangeset for help on using the changeset viewer.