AdguardTeam / FiltersCompiler

A tool that compiles & validates filters
GNU Lesser General Public License v3.0
52 stars 12 forks source link

Mark multiple rules NOT_OPTIMIZED #141

Closed ameshkov closed 2 years ago

ameshkov commented 2 years ago

Check this: https://github.com/AdguardTeam/AdguardFilters/pull/113722#issuecomment-1077851428

Currently, we have to add a hint to every rule like this:

!+ NOT_OPTIMIZED
||example.org^

It'd be great if we had an option to mark multiple rules (or maybe the whole file) not optimized.

@Yuki2718 FYI

Alex-302 commented 2 years ago

Why not to disable optimization for this filter? It does not contain too much rules.

Yuki2718 commented 2 years ago

Why not to disable optimization for this filter? It does not contain too much rules.

Maybe for future use? Similar to PLATFORM vs !#if (conditions).

ameshkov commented 2 years ago

@Alex-302 it's rather large tbh, and growing fast

ameshkov commented 2 years ago

Actually, we have something that can be used already: https://github.com/AdguardTeam/FiltersDownloader/commit/86a31665536b6dc55d4075972593e48b594575f4

However, I don't really like the current implementation since #include-not-optimized is not supported by blockers. Also, the "optimization" process is the process that we conduct server-side, it should be controlled by the !+ hints, not pre-processor directives.

@maximtop we could slightly change the definition of it: allow !+ hints to be applied to the @include directives.

Please note, that I specifically talk about @include and !+ directives, the ones that are interpreted by the FiltersRegistry only and not interpreted by the downloader itself.