| Summary: | MediaQuerySet wastes a lot of vector capacity | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> | ||||
| Component: | CSS | Assignee: | Chris Dumez <cdumez> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | cdumez, commit-queue, koivisto, simon.fraser, webkit-bug-importer, zalan | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Simon Fraser (smfr)
2018-06-15 14:43:33 PDT
Tooling in bug 186698. Created attachment 342856 [details]
Patch
Comment on attachment 342856 [details] Patch Kling's previous changes here did a lot more shrinking: https://trac.webkit.org/changeset/204006. I also wonder if we should shrink MediaQuery's m_expressions vector. (In reply to Simon Fraser (smfr) from comment #5) > Comment on attachment 342856 [details] > Patch > > Kling's previous changes here did a lot more shrinking: > https://trac.webkit.org/changeset/204006. I also wonder if we should shrink > MediaQuery's m_expressions vector. The code has not changed and is still there: void MediaQuerySet::shrinkToFit() { m_queries.shrinkToFit(); for (auto& query : m_queries) query.shrinkToFit(); } Comment on attachment 342856 [details]
Patch
OK
(In reply to Chris Dumez from comment #6) > (In reply to Simon Fraser (smfr) from comment #5) > > Comment on attachment 342856 [details] > > Patch > > > > Kling's previous changes here did a lot more shrinking: > > https://trac.webkit.org/changeset/204006. I also wonder if we should shrink > > MediaQuery's m_expressions vector. > > The code has not changed and is still there: > void MediaQuerySet::shrinkToFit() > { > m_queries.shrinkToFit(); > for (auto& query : m_queries) > query.shrinkToFit(); > } I am looking at r204006 but I am not convinced it does more shrinking. We still shrink both the MediaQuerySet and every query in the vector. Also, on ToT, MediaQuerySet::create() is only called in MediaQueryParser, and shrink there after we're done parsing. MediaQuerySet::create(const String&, MediaQueryParserContext&), calls MediaQueryParser::parseMediaQuerySet() which calls MediaQueryParser(MediaQuerySetParser, context).parseInternal(range) where I do the shrinking. I am therefore confident I shrink all MediaQuerySet objects, right after they're parsed. Comment on attachment 342856 [details] Patch Clearing flags on attachment: 342856 Committed r232898: <https://trac.webkit.org/changeset/232898> All reviewed patches have been landed. Closing bug. *** Bug 186713 has been marked as a duplicate of this bug. *** |