Use string pattern matching instead of regex to implement MatchGlob
Categories
(WebExtensions :: General, enhancement)
Tracking
(Not tracked)
People
(Reporter: jrmuizel, Assigned: jrmuizel)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
This avoids the cost having to compile the regular expressions during startup and I expect the matching will be a similar speed for most expressions. In any case, actual match speed shouldn't be too much of a bottleneck because we match on domains first and it will be no slower than Chrome.
| Assignee | ||
Comment 1•7 days ago
|
||
This takes the code from base/strings/pattern* at revision
0c26a6fd68e146fc98becc4b69e8c2e8cdcc0ea6 and makes
it operate on nsStrings.
Like in Chromium it will be used to implement webRequest
match patterns.
Updated•7 days ago
|
| Assignee | ||
Comment 2•7 days ago
|
||
This avoids the cost having to compile the regular expressions during startup
and I expect the matching will be a similar speed for most expressions. In any
case, actual match speed shouldn't be too much of a bottleneck because we match
on domains first and it will be no slower than Chrome.
We spend 22ms compiling regexes during Fenix startup so this should
help there:
https://share.firefox.dev/4qXikKP
| Assignee | ||
Comment 3•7 days ago
|
||
The new MatchPattern code shouldn't be much slower than the fast path and this
keeps things simpler. It also matches what Chromium does.
| Assignee | ||
Comment 4•7 days ago
|
||
I also have a Rust version of the string pattern matching if there's a preference for that: https://github.com/jrmuizel/chromium-string-pattern/blob/main/src/lib.rs
| Assignee | ||
Updated•7 days ago
|
Description
•