Skip to content
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

Persistent high CPU load on some web sites #253

Closed
ms1121 opened this issue Sep 11, 2018 · 48 comments

Comments

@ms1121
Copy link

commented Sep 11, 2018

While the tab is selected, I am seeing high CPU usage in Firefox on some web sites… as if a thread is remaining active and the process never completes. When I disable CanvasBlocker in about:addons and select the tab again, Firefox CPU loading for the page has returned to its normal idle state.

Example: https://homebiogas.com/

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Sep 11, 2018

How many notifications do you see in the notification popup?
grafik

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Sep 13, 2018

Can you please try the latest Alpha (you have to disable the normal first): https://github.com/kkapsner/CanvasBlocker/releases/tag/0.5.4-Alpha3

@kkapsner

This comment has been minimized.

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Sep 23, 2018

@tavyra

This comment has been minimized.

Copy link

commented Sep 27, 2018

I'm on 0.5.4 and the problem still exists. Here's an address that will produce the problem without fail: https://www.windowscentral.com/how-use-custom-environments-windows-mixed-reality

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Sep 29, 2018

Well... this pages requests ~200 DOMRect values per second - it seems that it's the ads. If I simply activate µBlock the number of requested DOMRects and therefore the CPU loads goes down.

As CB fakes this value I'm not surprised that you see an CPU load increase. But there is little I can do about it. I already try to be as efficient as possible.

PS: you will not see the high DOMRect numbers as CB only reports once for requests for the same object.

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Sep 29, 2018

Can you please check which protection causes the problems on the other pages?

@tavyra

This comment has been minimized.

Copy link

commented Oct 5, 2018

I use ublock origin and umatrix, is there a rule or something I should add to keep this from happening? Disabling CB makes my cpu idle normally but I've only got like 70 notifications from ublock+umatrix+disconnect combined. I'm not sure what the other pages were that ended up freezing firefox and I can't think of any other add-ons that would be interfering.

Not knocking your efficiency either, with the exception of the random page that goes from 5% to 100% like a supercar, I haven't noticed any performance impact.

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Oct 6, 2018

I do not know of a specific rule. I also use NoScript which also helps.

With number of notifications I mean the number in the page action popup (see screenshot in first comment).

@mitomenai

This comment has been minimized.

Copy link

commented Oct 23, 2018

I'm seeing some pretty bad performance dips on Amazon as of late. Browsing to a product and scrolling is extremely choppy, even after comments load. Issue seems to be stemming from DOMRect API.

Meanwhile, Audio API causes https://amiunique.org/fp to completely lock up.

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Oct 23, 2018

Can you give an example link for amazon? It runs well for me.

The amiunique thing is known and there is not really anything I can do about it - they use a very poorly written script.
You can disable the audio cache temporarily to let it run a little bit faster. But I can tell you that it will say that you are unique...
If you want to test if the fingerprint is changing with every load you can use the CB test pages: https://canvasblocker.kkapsner.de/test/

@mitomenai

This comment has been minimized.

Copy link

commented Oct 24, 2018

Here's a random link:
https://www.amazon.com/Ultraviolet-Sanitizer-Sanitizing-Portable-Bacteria/dp/B007DK8FKW/

Keep scrolling, and once you hit the reviews it turns into a slideshow. Turning off DOMRect immediately resolves the issue.

I disabled all other addons, and the issue is still exhibited.

@spodermenpls

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2018

@Leeweez I can't reproduce this issue either.. maybe open a new Issue, to share detailed information about your configurations and console logs?

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Oct 24, 2018

Same for me. Page scrolls fine.

@kokoko3k

This comment has been minimized.

Copy link

commented Oct 30, 2018

For me, it slows down on amazon when the mouse is on the image product and the zoomed version appears to the right.
--EDIT--
You may need to search i also tried to disable the protection for dom api, but it is still slow.
the only way to make it fast seems to disable the extension.

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Oct 31, 2018

What do you see in the page action popup:
grafik

@kokoko3k

This comment has been minimized.

Copy link

commented Nov 5, 2018

Sorry for the delay, i see the following:
Faked DOMRect readout on www.amazon.it (157)

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Nov 9, 2018

Can you please give me your settings?

@kokoko3k

This comment has been minimized.

Copy link

commented Nov 9, 2018

Here they are (i've whitelisted amazon)

{
	"logLevel": 1,
	"urlSettings": [
		{
			"url": "www.amazon.it",
			"blockMode": "allowEverything"
		}
	],
	"hiddenSettings": {},
	"expandStatus": {
		"blockMode": true
	},
	"displayHiddenSettings": false,
	"whiteList": "",
	"sessionWhiteList": "",
	"blackList": "",
	"blockMode": "fakeReadout",
	"minFakeSize": 1,
	"maxFakeSize": 0,
	"rng": "nonPersistent",
	"protectedAPIFeatures": {},
	"useCanvasCache": true,
	"ignoreFrequentColors": 0,
	"minColors": 0,
	"fakeAlphaChannel": false,
	"persistentRndStorage": "",
	"persistentIncognitoRndStorage": "",
	"storePersistentRnd": false,
	"persistentRndClearIntervalValue": 0,
	"persistentRndClearIntervalUnit": "days",
	"lastPersistentRndClearing": 1541763252068,
	"askOnlyOnce": "individual",
	"askDenyMode": "block",
	"showCanvasWhileAsking": true,
	"showNotifications": true,
	"highlightPageAction": "none",
	"highlightBrowserAction": "color",
	"displayBadge": true,
	"storeNotificationData": false,
	"storeImageForInspection": false,
	"ignoreList": "",
	"ignoredAPIs": {},
	"showCallingFile": false,
	"showCompleteCallingStack": false,
	"enableStackList": false,
	"stackList": "",
	"protectAudio": true,
	"audioFakeRate": "100",
	"audioNoiseLevel": "minimal",
	"useAudioCache": true,
	"audioUseFixedIndices": true,
	"audioFixedIndices": "11",
	"historyLengthThreshold": 2,
	"protectWindow": false,
	"protectDOMRect": true,
	"domRectIntegerFactor": 4,
	"blockDataURLs": true,
	"displayAdvancedSettings": false,
	"displayDescriptions": false,
	"theme": "default",
	"dontShowOptionsOnUpdate": false,
	"isStillDefault": false,
	"storageVersion": 0.4
}
@kkapsner

This comment has been minimized.

Copy link
Owner

commented Nov 10, 2018

Hm... I do not see anything bad there. Does the problem persist when you disable the DOMRect protection?

@kokoko3k

This comment has been minimized.

Copy link

commented Nov 12, 2018

Hi,
if i disable DOMRect API protection, the problem goes away.

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Nov 12, 2018

Hm... I still cannot reproduce but I recommend that you then only disable the DOMRect API for amazon and not whitelist it completely.

@kokoko3k

This comment has been minimized.

Copy link

commented Nov 13, 2018

Thanks, but it is not clear to me how to disable just the DOMRect API for a specific site.
In the specific site option, i've "block only blacklist", but i'm unable to find where to edit this blacklist, or maybe i'm completely wrong and there's another way (?)

-EDIT-
Whops, sorry, i completely missed the checkbox :)

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Nov 15, 2018

For all other searchers:
image

@Lucapz

This comment has been minimized.

Copy link

commented Dec 5, 2018

Someone on a forum had an old Windows XP box that he had to disable CanvasBlocker on as it caused websites like Amazon to become choppy like others have mentioned and he all so had to disable it on a more modern Linux skylake box as 60fps media at Youtube would stutter but was perfectly fine when CanvasBlocker was disabled so something is causing a high overhead or I/O polling that it's not always practical to use?

It might be something to do with Firefoxes API as other extensions can become sluggish on certain pages as i've noticed this with lastpass taking forever.

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Dec 23, 2018

I always recommend to identify the part of CB that causes the slowdown (in the case of Youtube I would guess it's the DOMRect-API). The problematic parts can be disabled individually (also on a site by site level).

@lazycrypt

This comment has been minimized.

Copy link

commented Dec 29, 2018

I'm getting Firefox errors CanvasBlocker is slowing things down on https://steamdb.info.

This is what CanvasBlocker reports after the page loads (for instance, on the Sales page):

Faked DOMRect readout on steamdb.info
(92)
@kkapsner

This comment has been minimized.

Copy link
Owner

commented Dec 30, 2018

It's working fine for me - what are your settings and versions (Firefox/CB)?

@lazycrypt

This comment has been minimized.

Copy link

commented Jan 1, 2019

Other than appearance settings I'm running on the default CB settings. Testing it a bit more over the past two days the warning seems to appear only sometimes now. It could be that the official SteamDB Firefox addon could be conflicting with something, I'll test it out some more.

@codejodler

This comment has been minimized.

Copy link

commented Jan 31, 2019

Hello Korbinian,
I also noted excessive load after installing the CanvasBlocker addon/extension. Then i tried to figure things and found that another extension, EclipsedMoon (for the Palemoon browser) has a setting 'canvas.poison' checked, in the prefs section 'reduce fingerprinting', and when i uncheck that, the abnormal load is gone, at least on the few sites i tried since then.
This is not totally obvious since that Moon extension is supposed to fake useragents, but actually does a lot more.
So my idea is that the two are somehow fighting over the final result :D

I would not go so far as to notify the Eclipsed Moon developers. I mean, they're doing the best they can.
I think CanvasBlocker should just include a comment directly in the prefs, that the user is responsible for having not any other plugin mingling into the Canvas business.
Cheers,
mi

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Jan 31, 2019

Hm... I'm not quite sure where to put such a comment so it's not too in the way but the people read it.

@spodermenpls

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2019

@kkapsner Maybe put such a disclaimer just in the descriptions here and on AMO for now?

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Feb 2, 2019

Sounds like a good idea.

kkapsner added a commit that referenced this issue Feb 2, 2019

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Feb 2, 2019

Done

@mutantsushi

This comment has been minimized.

Copy link

commented Feb 13, 2019

This is website that triggers persistent script/CPU warning:
https://paizo.com/community/forums/pathfinder/playtest

Also, it happens on Twitter.

The warning doesn't occur, but Disqus discussions won't even display without CB disabled.
(not even logged in to be able to comment, but Disqus comments won't even load with CB)

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Feb 13, 2019

I don't get a single CanvasBlocker notification or warning on this page. Please check the notifications to get to know which API/scripts trigger the CB protection.

Twitter is probably the DOM-Rect API. It usually gets a little bit better if you disable the notifications for DOM-Rect.

I have no clue about the Disqus problem (but I know that their technological approach is horrible). Can you give me an example page?

@AeliusSaionji

This comment has been minimized.

Copy link

commented Mar 23, 2019

I've just installed this extension today and can attest to it causing serious performance issues.

Observe: https://aelius.keybase.pub/canvasblocker%20amazon%20image%20performance.mp4

@AeliusSaionji

This comment has been minimized.

Copy link

commented Mar 23, 2019

Also, even when I'm not interacting with the Amazon webpage, firefox is chewing through 20% of my CPU when canvas blocker is loaded. Disabling canvasblocker and refreshing the page allows firefox to idle again.

(I've since read through the thread and excluded amazon from DOM-Rect api, which does sidestep the issue)

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Mar 23, 2019

I am aware of this issue but have no good idea how to solve it. There is no good way to distinguish between fingerprinting and legit use of the DOMRect-API.

Maybe I should analyse the amazon code to get the exact problem...

@kkapsner

This comment has been minimized.

Copy link
Owner

commented May 4, 2019

The code at amazon is not great. It seems to me that they read the DOMRect more often than necessary. The numbers I get when I count every readout are insane (several thousand for one mouse movement). So the only thing I can do is to improve the overall performance of the DOMRect API.

kkapsner added a commit that referenced this issue May 4, 2019

kkapsner added a commit that referenced this issue May 4, 2019

Improved DOMRect performance
Factor 1.8 (For #253).

kkapsner added a commit that referenced this issue May 4, 2019

Further improved DOMRect performance
Additional factor 2.6 = total factor 4.7 (For #253).
@kkapsner

This comment has been minimized.

Copy link
Owner

commented May 4, 2019

I managed to get some performance improvements. The zoomed view at amazon is better but far of being good.

@kokoko3k

This comment has been minimized.

Copy link

commented May 6, 2019

Thanks kkapsner!

I'm thinking...
Would it be possible to add an "antihammer" option so that CanvasBlocker wouldn't allow more than (insert number here) requests per second?

@manyplay

This comment has been minimized.

Copy link

commented May 7, 2019

Hi,thx for the great addon!
Can you check the message system on ebay!
I have to disable the addon if i want to write a message...
The edit field is not writable...

@kkapsner

This comment has been minimized.

Copy link
Owner

commented May 7, 2019

@kokoko3k I could implement that but it would not help the user of such sites as it would completely break them. And despite it being written poorly it's a legitimate use of the API.

@manyplay please open a separate issue for your problem with all the details needed.

kkapsner added a commit that referenced this issue May 11, 2019

DOMRect: further performance improvements
Total improvement compared to 0.5.8: 7.2 (For #253)
@kkapsner

This comment has been minimized.

Copy link
Owner

commented May 11, 2019

With the latest improvements the amazon page is usable. Not good, but usable.

@kkapsner

This comment has been minimized.

Copy link
Owner

commented May 26, 2019

Please test the latest 0.5.9 as it has some performance improvements.

@kokoko3k

This comment has been minimized.

Copy link

commented May 27, 2019

Definitely better, thank you!

@kkapsner kkapsner added the bug label Jun 9, 2019

@kkapsner

This comment has been minimized.

Copy link
Owner

commented Jun 9, 2019

I think with 0.5.10 the performance is acceptable. So I will close this issue. If someone still has an example page that uses lots of CPU or is slow I can reopen this issue.

@kkapsner kkapsner closed this Jun 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.