Bug 270327 - WebExtensionContext::loadDeclarativeNetRequestRules takes 1.54s on the main thread loading Ghostery
Summary: WebExtensionContext::loadDeclarativeNetRequestRules takes 1.54s on the main t...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Extensions (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Hudson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-02-29 16:42 PST by Timothy Hatcher
Modified: 2024-03-11 19:55 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2024-02-29 16:42:54 PST
1.54 s      60.2%	0 s	 	 WebKit::WebExtensionContext::loadDeclarativeNetRequestRules(WTF::CompletionHandler<void (bool)>&&)::$_3::operator()()
1.24 s      48.5%	0 s	 	  +[_WKWebExtensionDeclarativeNetRequestTranslator translateRules:errorStrings:]
715.00 ms   28.0%	0 s	 	   -[_WKWebExtensionDeclarativeNetRequestRule ruleInWebKitFormat]
695.00 ms   27.2%	0 s	 	    -[_WKWebExtensionDeclarativeNetRequestRule _convertedRulesForWebKitActionType:chromeActionType:]
621.00 ms   24.3%	1.00 ms	 	     -[_WKWebExtensionDeclarativeNetRequestRule _webKitRuleWithWebKitActionType:chromeActionType:chromeResourceTypes:]
310.00 ms   12.1%	0 s	 	      -[_WKWebExtensionDeclarativeNetRequestRule _regexURLFilterForChromeURLFilter:]
113.00 ms    4.4%	0 s	 	       WebKit::escapeCharactersInString(NSString*, NSString*)
109.00 ms    4.2%	0 s	 	      -[_WKWebExtensionDeclarativeNetRequestRule _convertedResourceTypesForChromeResourceTypes:]

We should move the _WKWebExtensionDeclarativeNetRequestTranslator work off the main thread into a background queue.
Comment 1 Radar WebKit Bug Importer 2024-02-29 16:43:21 PST
<rdar://problem/123867301>
Comment 2 Rob Hudson 2024-03-11 15:05:45 PDT
Pull request: https://github.com/WebKit/WebKit/pull/25743
Comment 3 EWS 2024-03-11 19:55:41 PDT
Committed 275952@main (cedd7cbe9803): <https://commits.webkit.org/275952@main>

Reviewed commits have been landed. Closing PR #25743 and removing active labels.