Open Bug 2000235 Opened 7 days ago Updated 7 days ago

Use string pattern matching instead of regex to implement MatchGlob

Categories

(WebExtensions :: General, enhancement)

enhancement

Tracking

(Not tracked)

ASSIGNED

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.

See Also: → 2000052

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.

Assignee: nobody → jmuizelaar
Status: NEW → ASSIGNED

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

The new MatchPattern code shouldn't be much slower than the fast path and this
keeps things simpler. It also matches what Chromium does.

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

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: