Re:How the most popular Chrome extensions affect browser per...
by aasasd on Tuesday June 16, 2020 @04:47PM
(#23543896)
Yeah, back when I was doing similar matching on a big bunch of regexes, it was vastly faster to match on all of them lumped together in a group with the ‘or’ operator. And I learned of this more than fifteen years ago from a server-side lib that deduced the exact browser from the user-agent: it had a huge regex with various placeholders and a long list of ‘if/elseif’ checks to extract the values.
[ Parent
| on HN ]
Re:How the most popular Chrome extensions affect browser per...
by thomasahle on Tuesday June 16, 2020 @06:48PM
(#23545260)
Exactly. If your regex engine compiles to a DFA, you can have arbitrary many or clauses with no overhead. It's pretty neat.