Changeset 275483 in webkit


Ignore:
Timestamp:
Apr 5, 2021 8:08:15 PM (3 years ago)
Author:
Simon Fraser
Message:

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

Reviewed by Said Abou-Hallawa.

On youtube.com, about 50KB of vector capacity is wasted in SVGPathByteStream,
so shrink them after parsing.

  • svg/SVGPathByteStream.h:

(WebCore::SVGPathByteStream::shrinkToFit):

  • svg/SVGPathParser.cpp:

(WebCore::SVGPathParser::parseToByteStream):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r275481 r275483  
     12021-04-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Wasted vector capacity in SVGPathByteStream
     4        https://bugs.webkit.org/show_bug.cgi?id=224165
     5
     6        Reviewed by Said Abou-Hallawa.
     7
     8        On youtube.com, about 50KB of vector capacity is wasted in SVGPathByteStream,
     9        so shrink them after parsing.
     10
     11        * svg/SVGPathByteStream.h:
     12        (WebCore::SVGPathByteStream::shrinkToFit):
     13        * svg/SVGPathParser.cpp:
     14        (WebCore::SVGPathParser::parseToByteStream):
     15
    1162021-04-05  Simon Fraser  <simon.fraser@apple.com>
    217
  • trunk/Source/WebCore/svg/SVGPathByteStream.h

    r248846 r275483  
    9898    bool isEmpty() const { return m_data.isEmpty(); }
    9999    unsigned size() const { return m_data.size(); }
     100    void shrinkToFit() { m_data.shrinkToFit(); }
    100101
    101102private:
  • trunk/Source/WebCore/svg/SVGPathParser.cpp

    r263334 r275483  
    4444{
    4545    SVGPathByteStreamBuilder builder(byteStream);
    46     return parse(source, builder, mode, checkForInitialMoveTo);
     46    auto result = parse(source, builder, mode, checkForInitialMoveTo);
     47    byteStream.shrinkToFit();
     48    return result;
    4749}
    4850
Note: See TracChangeset for help on using the changeset viewer.