-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce filter list size by using domain popularity, updating encoding, and removing unapplicable rules #587
base: main
Are you sure you want to change the base?
Conversation
@@ -81,6 +81,7 @@ | |||
"dependencies": { | |||
"@ghostery/adblocker": "^2.0.4", | |||
"@ghostery/adblocker-content": "^2.0.4", | |||
"csv-parse": "^5.6.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this to devDependencies?
!line.startsWith('!') && | ||
!line.startsWith('##') && | ||
!line.startsWith('||') && | ||
!line.includes(':remove') && | ||
!line.includes(':upward') && | ||
!line.includes('redirect-rule'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some comments on what each of these prefixes mean and why we're filtering them out?
*/ | ||
async function rebuildFilterList() { | ||
await loadTrancoList(); | ||
await processFilterList('easylist_cookie_specific_uBO.txt'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we call processFilterlist() on all input files, not just "specific" ones?
for (const line in filteredLines) { | ||
const rule = filteredLines[line]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (const line in filteredLines) { | |
const rule = filteredLines[line]; | |
for (const rule of filteredLines) { |
This PR makes substantial changes to
rebuild-filterlist.mjs
andcompile-filterlist.mjs
in an effort to reduce the size of the filter list and ultimately the injected bundle with minimal impact to coverage.Notable changes:
Through these change we're able to reduce the resulting
filterlist-engine.ts
by over 60% (4.2M -> 1.8M), which should help significantly with performance.