To simplify, and speaking from uBO's perspective, consider that nine distinct tokens can be extracted from the URL in the address bar for the current webpage:
https
news
ycombinator
com
reply
id
41758007
goto
item%3Fid%3D41757178%2341758007
To match such URL against the tens of thousand of filters, there is only a need to lookup filters for these nine tokens, and for most of these tokens there won't be any filters to test, such that in the end for any given URL only a few to no filters will end up being tested, and the majority of these filters are not regex-based, they are just plain string matching.This is the overall simplified explanation of how it really works, in reality it's a bit more complex because there are a lot of other optimizations on top of this.
There is a built-in benchmark tool in uBO, accessible through the dashboard, _Support_ pane, _More_ button, _SNFE: Benchmark_ button[1].
When running the benchmark against a set of 230,364 URLs, I get an average of 11-12 µs per request to perform a match test against the default filter lists in uBO.
* * *
[1] https://github.com/gorhill/uBlock/wiki/Advanced-settings#ben...
A 386 could handle a regexp fine. Compare that to audio or video decoding for ads. Not the same ballpark by orders of magnitude.
It's dead because Google makes money from ads. I shifted to Firefox ages ago.
If the browser maintainers have seen a couple of machines with similar problems and maintainers of regexp-using add blockers simply insisted that their code was fast, "a 386 could handle" etc, I can easily see how the browser maintainers might lose patience. Don't need to assume ill will.
My comment wasn't that all algorithms are always efficient. It was that properly compiled regular expressions are.
Extensions often lead to performance issues.
It looks like the recent changes are all about slowly locking down what extensions can do because it’s currently a free for all where random anonymous extension owners have full access to everyone’s browsers.
The major browser vendors already have extension "stores" that are supposed to be curated. I believe it's also true that installing an extension directly ("side-loading") is usually disabled by default (or just not an option at all).
They've done their due diligence for our "safety". Now, it's just bullshit to prevent us from blocking ads, trackers, and spyware.
Granted, I'm sure malware slips through. But, what security danger is there to a user if an extension blocks a network request? Manifest V3 eliminating the ability to block network requests is NOT for user security. The absolute best excuse they can come up with is that it has something to do with performance, but that's also bullshit because I'm 99% sure I can find plenty of ways to make a Manifest V3 extension waste CPU and/or memory.