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

Possibility to set the TIME constant in the raf function #192

Open
pdwinkel opened this issue Jan 11, 2023 · 1 comment
Open

Possibility to set the TIME constant in the raf function #192

pdwinkel opened this issue Jan 11, 2023 · 1 comment
Labels
info needed Extra information is needed to address the issue

Comments

@pdwinkel
Copy link

Currently the code is as follows:

var TIME = Math.floor(1000 / 60);

Which results in a CPU usage of ~100%.
Setting TIME to, e.g. Math.floor(1000 / 30), reduces the CPU usage to 50-60%.

So, please add an option to set this TIME

@catdad
Copy link
Owner

catdad commented Sep 8, 2023

I am confused by this request. The time variable limits the animation to 60fps (which was previously an issue for high refresh rate monitors). Changing that, while possible, would make the animation choppy. In essence, changing it to 30fps will draw half as often.

You are mentioning CPU usage, which is related to how much confetti is being used. To lower CPU usage, you can use less confetti. Or rather, CPU usage will go right back up if you lower the framerate and increase the amount of confetti. I am not sure that a configurable framerate is the answer to performance issues. Can you clarify what case you are seeing these performance issues in?

@catdad catdad added the info needed Extra information is needed to address the issue label Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info needed Extra information is needed to address the issue
Projects
None yet
Development

No branches or pull requests

2 participants