Workspace page taking a lot of CPU (25%)


#1

I noticed that the workspace page (https://hyperdev.com/#!/project/…) is continuously taking 25% CPU (in chrome task manager), and it makes my CPU fan extremely noisy.
I investigated a little bit by profiling the page using google chrome dev tools, and found that there is actually a renderning function that is continuously taking 100% CPU.

After a deeper investigation, i found that it was particular module called “Confetti” that was rendering and taking so much resources.

After an even deeper investigation, i found that this module is attached to 2 canvases on the main page called confetti-foreground and confetti-background. The Confetti module actually creates these canvases and is continuously rendering them (requestAnimationFrame).
The purpose of these canvases seems to be making a fancy confetti animation when a user donates money to HyperDev. The problem is that this animation is taking resources all the time when it shouldn’t.

Can somebody patch the client code so this animation really hides and stops taking CPU when it shouldn’t ?

The only solution i found for the moment is overriding the native requestAnimationFrame function with an empty function before the main script loads:

requestAnimationFrame = () => {}

Thanks for your help !

BTW, HyperDev is a crazy awesome project ! :smiley:


#2

Wow, thank you for the detailed and thorough investigation! We should be able to fix this pretty soon, I’ll let you know when it’s live.


#3

Ok thank you for the quick reply :slight_smile:
I also sent a feedback message about this issue, i wasn’t sure about the right way to report a bug.
Sorry about that :sweat_smile:


#4

Both ways to report a bug are fine, though I’m partial to the forum.

The fix is deployed, enjoy your cooler, quieter CPU :smile:


#5

Wow ! This is what i call a hot fix !

Thank you so much.
And don’t hesitate to ask if you need volunteers to help on the platform. :smirk:

Cheers !