Open atuchin-m opened 1 year ago
Currently we use rust Regex to match adblock regular expression. As discovered in https://github.com/brave/brave-browser/issues/26892, it consumes a lot of memory.
In chromium we a few alternative engines:
Regex
declarativeNetRequest
UrlMatcher
The task is to compare the performance/memory consumption of these engine for typical adblock regular expressions.
Also changing the regex engine to C++ implementation implies moving adblock engine to sandbox process (the rule of 2)
@atuchin-m shouldn't we also look at why it consumes so much memory? Have you reported this issue to rust? Or is there another rust regex implementation that is better?
Currently we use rust Regex to match adblock regular expression. As discovered in https://github.com/brave/brave-browser/issues/26892, it consumes a lot of memory.
In chromium we a few alternative engines:
Regex
: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_ExpressionsdeclarativeNetRequest
: https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#type-RegexOptionsUrlMatcher
: https://source.chromium.org/chromium/chromium/src/+/main:components/url_matcher/url_matcher.h;l=119The task is to compare the performance/memory consumption of these engine for typical adblock regular expressions.
Also changing the regex engine to C++ implementation implies moving adblock engine to sandbox process (the rule of 2)