4 ms·
I think the fastest data structure for this is to replace the whole thing by one big finite state transducer https://blog.burntsushi.net/transducers/ https://bl
by nextaccountic 5y ago
I think the fastest data structure for this is to replace the whole thing by one big finite state transducer https://blog.burntsushi.net/transducers/ https://blog.burntsushi.net/transducers/ - such data structure can be built from the EasyList regexes, and perform all checks in a single lookup.
The idea here would be to compile the regex of each rule to an automata (each automata matches a set of strings) and them build a fst out of them (that would map strings to matched rules)
- jhgb 5y agoIs it really the fastest way? I imagine that without extra data it may be, but what I was proposing in a cousin comment would involve profiling and early fast rejection by means of efficient multiple string matching. The browser should be able to collect a significant amount of historical matching data to optimize these lookups.