particles.js icon indicating copy to clipboard operation
particles.js copied to clipboard

Very high CPU usage.

Open justalec opened this issue 6 years ago • 11 comments

I noticed very high CPU usage, it goes even to 100%. Tested on i5 quad core.

justalec avatar Feb 17 '18 19:02 justalec

@LegitSoulja @justalec It's because there are unrestricted calls to request animation frame. High utilization does not necessarily mean poor processing or slowness. For example, in video games, it can be a good thing. I have forked the project and waiting for a merge, you can download a fix there (see #286 ).

caldempsey avatar Feb 20 '18 18:02 caldempsey

Hi, I also have very high cpu usage, running an i7 4770k so CPU is not an issue. @mmacheerpuppy can you please help me out? I don't think limiting the FPS is doing anything for me in this regards.

EDIT: This only happens in Google Chrome and only on my desktop, which is confusing. Tested it on other machines and it works fine, Firefox loads the particles just fine o_o

ImranChowdhry avatar Feb 28 '18 04:02 ImranChowdhry

Hi @ImranChowdhry

I also have a 4770k :).

So your problem isn't the speed of your CPU, it's closer to the idea that the Javascript code runs as fast as your CPU is able to handle. If you check the pull request I made it'll highlight it in a bit more clarity https://github.com/VincentGarreau/particles.js/pull/286 (think of unlocking the FPS on video games to help ease your imagination).

I'm willing to bet that Google Chrome is your main browser and the old JS library has been cached by Google Chrome, in other words if the FPS limiter works for Firefox, but does not work for your other browsers there is a good chance you just need to clear your cache.

You can try my version of the lib here https://github.com/mmacheerpuppy/particles.js, see the documentation under the bugfix header and example JSON how to set the FPS value (which will, at most, v-sync to your monitor).

Best, mma

caldempsey avatar Mar 01 '18 16:03 caldempsey

I created an alternative to particles.js which comes with WebGL support and allows limiting the FPS to your liking. It is way easier on your CPU and doesn't waste resources when it's not necessary. https://github.com/T-vK/SuperParticles

T-vK avatar Feb 04 '19 02:02 T-vK

Also get 100% on my i7-8650U with YaBrowser/19.4.2.702 (Chrome 73)

david50407 avatar May 17 '19 14:05 david50407

Try my patch

Very best, Callum Dempsey Leach www.callumleach.com


From: David Kuo [email protected] Sent: 17 May 2019 15:45:09 To: VincentGarreau/particles.js Cc: Callum Dempsey Leach; Mention Subject: Re: [VincentGarreau/particles.js] Very high CPU usage. (#283)

Also get 100% on my i7-8650U with YaBrowser/19.4.2.702 (Chrome 73)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/VincentGarreau/particles.js/issues/283?email_source=notifications&email_token=ACDZIFPO6TEDKVZA6J6C2RDPV3AHLA5CNFSM4ERFXH62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVU6QLY#issuecomment-493479983, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACDZIFMA6VJHUEYMVCYPS23PV3AHLANCNFSM4ERFXH6Q.

caldempsey avatar May 17 '19 18:05 caldempsey

@mmacheerpuppy nop, it doesn't help anything. since my fps are both low (around 25) on your patch and original one with this demo http://codepen.io/VincentGarreau/pen/pnlso

david50407 avatar May 20 '19 01:05 david50407

What device are you viewing it with, what browser? The FPS always caps roughly around the same refresh rate as your monitor. I get 60FPS here. If you could provide more details of your environment I should be able to help more.


From: David Kuo [email protected] Sent: 20 May 2019 02:15 To: VincentGarreau/particles.js Cc: Callum Dempsey Leach; Mention Subject: Re: [VincentGarreau/particles.js] Very high CPU usage. (#283)

@mmacheerpuppyhttps://github.com/mmacheerpuppy nop, it doesn't help anything. since my fps are both low (around 25) on your patch and original one with this demo http://codepen.io/VincentGarreau/pen/pnlso

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/VincentGarreau/particles.js/issues/283?email_source=notifications&email_token=ACDZIFO4RI2QFOK6HBCWNMLPWH3UVA5CNFSM4ERFXH62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVXPEJQ#issuecomment-493810214, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACDZIFLFJIIODPBJJDEZKELPWH3UVANCNFSM4ERFXH6Q.

caldempsey avatar May 20 '19 08:05 caldempsey

@mmacheerpuppy i7-8650U with YaBrowser/19.4.2.702, actually it is Surface Book 2.

david50407 avatar May 20 '19 13:05 david50407

Any chance you could identify the refresh rate of your display?


From: David Kuo [email protected] Sent: 20 May 2019 14:18 To: VincentGarreau/particles.js Cc: Callum Dempsey Leach; Mention Subject: Re: [VincentGarreau/particles.js] Very high CPU usage. (#283)

@mmacheerpuppyhttps://github.com/mmacheerpuppy i7-8650U with YaBrowser/19.4.2.702, actually it is Surface Book 2.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/VincentGarreau/particles.js/issues/283?email_source=notifications&email_token=ACDZIFNWSI4QEG7KVDCGIG3PWKQJFA5CNFSM4ERFXH62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVYZMIY#issuecomment-493983267, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACDZIFMXO32QJMACKMVGZ4TPWKQJFANCNFSM4ERFXH6Q.

caldempsey avatar May 20 '19 13:05 caldempsey

This repository should fix that issue https://github.com/matteobruni/tsparticles

matteobruni avatar Jun 14 '20 14:06 matteobruni