AdguardTeam / AdguardBrowserExtension

AdGuard browser extension
https://adguard.com/
GNU General Public License v3.0
3.11k stars 331 forks source link

'Help with the development of AdGuard filters' degrades browser performance #2931

Closed x-rated closed 1 month ago

x-rated commented 2 months ago

Please answer the following questions for yourself before submitting an issue

AdGuard Extension version

5.0.57

Browser version

128

OS version

Windows 11 24H2

Ad Blocking

AdGuard Base filter, AdGuard Mobile Ads filter

Privacy

AdGuard Tracking Protection filter, AdGuard URL Tracking filter

Social

AdGuard Social Media filter

Annoyances

AdGuard Cookie Notices filter, AdGuard Popups filter, AdGuard Mobile App Banners filter, AdGuard Other Annoyances filter, AdGuard Widgets filter

Security

Online Malicious URL Blocklist, Phishing URL Blocklist, Scam Blocklist by DurableNapkin, uBlock Origin โ€“ Badware risks

Other

AdGuard Experimental filter

Language-specific

EasyList Czech and Slovak

What Tracking protection options do you have enabled?

Block trackers, Remove tracking parameters, Hide your search queries, Ask websites not to track you, Hide Referrer from third parties, Remove X-Client-Data header

Issue Details

Steps to reproduce:

  1. run the test https://browserbench.org/Speedometer3.0/ with version 5.0.57
  2. run the test https://browserbench.org/Speedometer3.0/ with version 5.0.42 (or 49, not sure)

Expected Behavior

results should be the same

Actual Behavior

with the newer version results are poor (-25% in my case)

Screenshots

5.0.57 ![68747470733a2f2f63646e2e616467756172642e696e666f2f736974657265706f7274732f313472683676747666396b306767777734347773676b77343873773834346b656a386c6163726f7279672e706e673f6e633d31](https://github.com/user-attachments/assets/b06835be-3542-42a0-be25-9b4ac5184885)
adguard disabled, performance similar to 5.0.42 (or 49, not sure) ![68747470733a2f2f63646e2e616467756172642e696e666f2f736974657265706f7274732f35383178326a726d746a386b73343830636f6b6b636f773067636367736330366c357232337963676f772e706e673f6e633d31](https://github.com/user-attachments/assets/6bca766a-219d-4234-acae-97c8bc8b1a3b)
ublock origin lite mv3 for comparison ![ublock](https://github.com/user-attachments/assets/e1489f67-f614-4633-8545-e8f9babbdbe5)

Additional Information

No response

Alex-302 commented 2 months ago

I have the same result with and without AdGuards (CPU - Ryzen 7800x3d)

Details ![image](https://github.com/user-attachments/assets/725c5ba6-1159-40ae-bec5-84c382a97fa8)
alexx7311 commented 2 months ago

@x-rated, hello! I don't see the difference either.

x-rated commented 2 months ago

i tried clean install of adguard with same settings, but still 25% lower ๐Ÿ˜ can i download version 5.0.42 somewhere? ๐Ÿค”

alexx7311 commented 2 months ago

@x-rated Here's 5.0.43 https://uploads.adguard.org/chrome-mv3_v5.0.43-beta.zip and this is 5.0.49 https://uploads.adguard.org/chrome-mv3_v5.0.49-beta.zip

x-rated commented 2 months ago

@alexx7311 thank you for sharing the links

for me last version without performance loss is 5.0.43 ๐Ÿค” 5.0.49 is already slow as 5.0.57 something definitelly went wrong there after 5.0.43 ๐Ÿ˜ my cpu is i9-9900K

5.0.43 ![5043](https://github.com/user-attachments/assets/d015e514-561e-4ff1-9565-f06a06da7eaf)
5.0.49 ![5049](https://github.com/user-attachments/assets/fe2cd4af-8dd7-44c4-b962-12448d02a1e8)

i used these settings in all versions: {"protocol-version":"2.0","general-settings":{"allow-acceptable-ads":false,"show-blocked-ads-count":true,"autodetect-filters":true,"safebrowsing-enabled":false,"filters-update-period":-1,"appearance-theme":"system"},"extension-specific-settings":{"use-optimized-filters":false,"collect-hits-count":true,"show-context-menu":true,"show-info-about-adguard":false,"show-app-updated-info":true,"hide-rate-adguard":false,"user-rules-editor-wrap":false},"filters":{"enabled-filters":[2,3,4,5,11,17,18,19,20,21,22,105,208,255,256,257],"enabled-groups":[0,1,2,3,4,5,6,7],"custom-filters":[],"user-filter":{"enabled":true,"rules":"","disabled-rules":""},"allowlist":{"enabled":true,"inverted":false,"domains":[],"inverted-domains":[]}},"stealth":{"stealth-disable-stealth-mode":false,"stealth-hide-referrer":false,"stealth-hide-search-queries":true,"stealth-send-do-not-track":true,"stealth-block-webrtc":false,"stealth-remove-x-client":true,"stealth-block-third-party-cookies":true,"stealth-block-third-party-cookies-time":2880,"stealth-block-first-party-cookies":false,"stealth-block-first-party-cookies-time":4320,"block-known-trackers":true,"strip-tracking-parameters":true}}

with 5.0.49 and later i notice little lags during the test progress - always in first thirds of each segment ๐Ÿค” approximately marked in the screenshot bellow (except for the first segment which is always laggy even without adguard)

lags ![lag](https://github.com/user-attachments/assets/735938d0-de5b-435a-90a6-c14909d6df05)
x-rated commented 2 months ago

after a bit of testing, i managed to reach full score 20+ points in 5.0.57 ๐Ÿ˜ฎ it has something to do with these settings ๐Ÿค”

i had to turn all these switches off and restart the anonymous window i was testing in ๐Ÿค” but it is weird - when i turn off only couple of them, there was always same low score -25% ๐Ÿค”

these are my new settings for better performance {"protocol-version":"2.0","general-settings":{"allow-acceptable-ads":false,"show-blocked-ads-count":false,"autodetect-filters":true,"safebrowsing-enabled":false,"filters-update-period":-1,"appearance-theme":"system"},"extension-specific-settings":{"use-optimized-filters":false,"collect-hits-count":false,"show-context-menu":false,"show-info-about-adguard":false,"show-app-updated-info":false,"hide-rate-adguard":false,"user-rules-editor-wrap":false},"filters":{"enabled-filters":[2,3,4,5,11,17,18,19,20,21,22,105,208,255,256,257],"enabled-groups":[0,1,2,3,4,5,6,7],"custom-filters":[],"user-filter":{"enabled":false,"rules":"","disabled-rules":""},"allowlist":{"enabled":false,"inverted":false,"domains":[],"inverted-domains":[]}},"stealth":{"stealth-disable-stealth-mode":false,"stealth-hide-referrer":false,"stealth-hide-search-queries":true,"stealth-send-do-not-track":true,"stealth-block-webrtc":false,"stealth-remove-x-client":true,"stealth-block-third-party-cookies":true,"stealth-block-third-party-cookies-time":2880,"stealth-block-first-party-cookies":false,"stealth-block-first-party-cookies-time":4320,"block-known-trackers":true,"strip-tracking-parameters":true}}

screen recordings from testing - you can notice that "bad score" video is twice longer + those lags in first thirds of segments at the bottom i mentioned earlier ๐Ÿค”

maximtop commented 2 months ago

probably it should be enough to disable only "help with adguard filters development" setting

x-rated commented 2 months ago

@maximtop thats it ๐Ÿ˜ฎ this is the only switch which slows down the performance after 5.0.43 โ˜ ๏ธ i didnt test all possible combinations before, just randomly these "for me not so important" features ๐Ÿ˜

maximtop commented 1 month ago

@x-rated This is expected because it involves a resource-intensive operation. When this setting is enabled, the AdGuard script traverses all elements to determine which ones are being blocked, which can impact performance.