Bug 237002

Summary: CachedResourceLoader::allCachedSVGImages() reparses resource URLs unnecessarily
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, darin, ews-watchlist, ggaren, japhet, jbedard, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Chris Dumez
Reported 2022-02-21 15:52:13 PST
CachedResourceLoader::allCachedSVGImages() reparses resource URLs unnecessarily: Sample Count, Samples %, Normalized CPU %, Symbol 40, 0.1%, 0.0%, WebCore::CachedResourceLoader::allCachedSVGImages() const (in WebCore) 34, 0.1%, 0.0%, WebCore::CachedResourceLoader::cachedResource(WTF::String const&) const (in WebCore) 31, 0.1%, 0.0%, WebCore::Document::completeURL(WTF::String const&, WebCore::ScriptExecutionContext::ForceUTF8) const (in WebCore) 31, 0.1%, 0.0%, WebCore::Document::completeURL(WTF::String const&, WTF::URL const&, WebCore::ScriptExecutionContext::ForceUTF8) const (in WebCore) 30, 0.0%, 0.0%, WTF::URL::URL(WTF::URL const&, WTF::String const&, WTF::URLTextEncoding const*) (in JavaScriptCore) 30, 0.0%, 0.0%, WTF::URLParser::URLParser(WTF::String const&, WTF::URL const&, WTF::URLTextEncoding const*) (in JavaScriptCore) 29, 0.0%, 0.0%, void WTF::URLParser::parse<unsigned char>(unsigned char const*, unsigned int, WTF::URL const&, WTF::URLTextEncoding const*) (in JavaScriptCore)
Attachments
Patch (3.72 KB, patch)
2022-02-21 15:57 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2022-02-21 15:57:17 PST
Jonathan Bedard
Comment 2 2022-02-22 08:22:03 PST
Stopped https://ews-build.webkit.org/#/builders/70/builds/974, the 3 failures seen are already known.
Chris Dumez
Comment 3 2022-02-22 08:28:49 PST
(In reply to Jonathan Bedard from comment #2) > Stopped https://ews-build.webkit.org/#/builders/70/builds/974, the 3 > failures seen are already known. Oh, thank you for letting me know! My patch touches SVG and the 3 failures were on SVG tests so I was about to investigate.
Darin Adler
Comment 4 2022-02-22 14:46:22 PST
Comment on attachment 452790 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=452790&action=review > Source/WebCore/ChangeLog:10 > + Store URLs in the HashMaps instead of Strings since we have URLs initially and we > + need URLs eventually. This avoids having to re-parse the URL unnecessarily, which > + is fairly expensive. It also makes the maps bigger; URLs share the strings, but the parsed offsets are separate in each URL. Hope that extra memory use is OK.
EWS
Comment 5 2022-02-22 17:27:41 PST
Committed r290341 (247661@main): <https://commits.webkit.org/247661@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 452790 [details].
Radar WebKit Bug Importer
Comment 6 2022-02-22 17:28:21 PST
Note You need to log in before you can comment on or make changes to this bug.