Canvasblocker: Causes slow page loading on https://www.cyberpunk.net/en/

Created on 27 Aug 2018  路  22Comments  路  Source: kkapsner/CanvasBlocker

This page https://www.cyberpunk.net/en/ responses very slowly with Canvas Blocker with default settings(fake readout API) turned on. Even Firefox warns that the extension is causing slowdown.

I hope this can be fixed.

  • CanvasBlocker Version used: 0.5.2b
  • Firefox version 64-bit: Firefox 62 Beta 20
  • Operating System: Windows 10
information needed

All 22 comments

Can you please try with disabled audio cache?

I assume the issue is gone. If you still have problems you can reopen this issue and provide the information I asked for.

I'm really sorry not to update you. Actually I tried it 3 days ago again, on September 11th and the problem still remains with the latest version. It's 3:38 AM here now. I will try to link a video recording the problem here later in the day.
Can you open the issue again please?

@kkapsner

you can reopen this issue

Actually, after a repo owner closed an issue, the issue creator can't reopen it anymore.. 馃槳

Even Firefox warns that the extension is causing slowdown.

I get these messages from time to time too lately (first time since the start of the webExtension era), after switching to Alpha 3 (I assume on sites that require a lot of faking, like Twitter.com)

Actually, after a repo owner closed an issue, the issue creator can't reopen it anymore..

Didn't know that. But they can ask me to reopen it.

I get these messages from time to time too lately (first time since the start of the webExtension era), after switching to Alpha 3 (I assume on sites that require a lot of faking, like Twitter.com)

What are the notifications like? Many DOMRects? Audio?

Oh... didn't see Hoaxes reply: well then - reopened.

OK - I just saw the problem for myself.

It's the distortion effect on the screenshots. This is poorly written code (they call getImageData over 100 times for this effect - I think once would be sufficient...).

Not sure what I should do in this case.

@kkapsner I've never seen a real world site yet that uses the audio API - Twitter only uses DOMRects and sometimes the Window API as far as I can remember. I'm not sure how to reproduce the slowdowns, as they happen sporadically without clear trigger.. maybe they're just Firefox slowdowns in general? The yellow slowdown bars only appeared for a split second, just enough to read "CanvasBlocker" in it. I will keep an eye on that issue.

Oh I see. It's complicated then.
Here's a clip which shows how it behaves on my PC. I've a slow internet connection so you can skip to 1:55 minute mark to check how to notification appears.
BTW, Later I minimized that tab for half an hour and then went back again and the same warning popped up.

https://drive.google.com/file/d/1BOIgUdYogbrY45r9MsUXulG7HqkH5BVG/view?usp=sharing

@kkapsner I did a little field research about the slowdown issues.. Youtube loses a noticeable amount of responsiveness with DOMRects protection activated, which is most prevalent in the comment sections, when opening answers under a comment (somewhat similar to the mentioned "critical" slowdowns on Twitter, which all happened during the initial loading of my feed) and in the chat box during livestreams (especially annoying).
This happens equally with Alpha2 or -3, so it's not likely to be a regression. You said in the DOMRects Issue:

The API itself and the faking is not a performance issue (it's just 4 numbers and not thousands as in the Canvas/Audio case). But if it is called that many times it sums up.

I saw that CB added in one instance 115 faked readouts at once, just for opening an answer feed below a YT comment, so I guess this explain the "extra second" of loading? Maybe the DOMRects API protection could need a hint then that it cuts away some websites' instant responsiveness (e.g. Youtube)..

I have one idea to make CB faster when many calls to an API are made.

@SeriousHoax I do not know what causes the slow down at the beginning. The yellow notification appears after you hovered over one of the screenshots. I think you have something additional that makes this page slow to render. Please make a reference test with CB disabled.

Since we know the script that is written badly you could enable the script white list and whitelist that:
grafik
[{"url": "https://www.cyberpunk.net/js/app-b2db76c708.14.js", "line": 16, "column": 288602}]

but I would not do this unless you really need this page to work smooth.

The page loads fine with CB disabled. But I get it. It's the fault of that script. Okay, thanks.

@kkapsner
Awesome job, once again! Your tweak makes a huge difference, the responsiveness of Youtube is now pretty much as good as it was without DOMRects protection. Twitter also loads extremely smooth now, compared with Alpha3. Additionally, the times at your canvas perfomance test page got cut almost in half (at least on my setup). Good thing, that I wasn't too shy to bring this up. 馃榿

On a site note, I am quite amazed how the DOMRects numbers fly through the roof during a Youtube livestream, with enough endurance you'd probably break the 1 million readouts barrier, with an activated chat box and lots of users participating..

Great - the performance test is not halved on my setup but also improved.

Yes - they use this quite extensively

@kkapsner I know now where the doubling in perfomance really stems from... plugging in my laptop's charging cable. 馃槀 The times drop then "only" from 4 to 3 ms, not from 6 to 3 ms, like observed above. Your tweak still makes a good difference though, during reduced CPU speed or whatever energy saving protocol is activated without my knowledge, so awesome job nevertheless!

That makes a lot more sense.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MPeti1 picture MPeti1  路  4Comments

concatime picture concatime  路  7Comments

ghost picture ghost  路  4Comments

spodermenpls picture spodermenpls  路  4Comments

nkestrel picture nkestrel  路  7Comments