Summary: | Regression(r177786): GlyphMetricsMap<T>::locatePageSlowCase() fills existing pages with unknown metrics | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||
Component: | WebCore Misc. | Assignee: | Chris Dumez <cdumez> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, darin, gyuyoung.kim, koivisto, mmaxfield | ||||
Priority: | P2 | ||||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 139971 | ||||||
Attachments: |
|
Description
Chris Dumez
2016-05-16 13:24:32 PDT
Created attachment 279040 [details]
Patch
Still testing locally. Found this by looking at PLT profiles that seeing that WebCore::GlyphMetricsMap<WebCore::FloatRect>::locatePageSlowCase(unsigned int) is slow. Comment on attachment 279040 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=279040&action=review Nice find, r=me > Source/WebCore/platform/graphics/GlyphMetricsMap.h:123 > + auto& pageInMap = m_pages->add(pageNumber, nullptr).iterator->value; > + if (!pageInMap) > + pageInMap = std::make_unique<GlyphMetricsPage>(unknownMetrics()); > + return *pageInMap; If you want to be fancy you could do something like return *m_pages.ensure(pageNumber, [] { return std::make_unique<GlyphMetricsPage>(unknownMetrics(); } ).iterator->value; Comment on attachment 279040 [details] Patch Clearing flags on attachment: 279040 Committed r201023: <http://trac.webkit.org/changeset/201023> All reviewed patches have been landed. Closing bug. Looks like a ~1% PLT progression on Mac. (In reply to comment #7) > Looks like a ~1% PLT progression on Mac. Ditto on iOS. |