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

Performance issues on Firefox #23

Open
enrickla opened this issue Mar 15, 2020 · 5 comments · May be fixed by #28
Open

Performance issues on Firefox #23

enrickla opened this issue Mar 15, 2020 · 5 comments · May be fixed by #28

Comments

@enrickla
Copy link

Hey! So everything seems fine on android and iOS but I got serious slow performance on Firefox after 10-15 sec and it's getting worst overtime.

Here is my code ("confetti-js": "0.0.17"):

const confettiSettings = { target: 'confetti-canvas', "max":"15", "size":"1", "start_from_edge":false, "respawn":true, "animate":false, "props":[
				{"type":"svg","src": this.state.storageURL + 'SVG/BC_p_line.svg',"size":25,"weight":0.05},
				{"type":"svg","src": this.state.storageURL + 'SVG/BC_p_circle_green.svg',"size":15,"weight":0.15},
				{"type":"svg","src": this.state.storageURL + 'SVG/BC_p_circle.svg',"size":15,"weight":0.15},
				{"type":"svg","src": this.state.storageURL + 'SVG/BC_p_square.svg',"size":7,"weight":0.15},
				{"type":"svg","src": this.state.storageURL + 'SVG/BC_p_dots.svg',"size":35,"weight":0.15},
				{"type":"svg","src": this.state.storageURL + 'SVG/BC_p_dots_green.svg',"size":35,"weight":0.15}   ], "colors":[[0,255,209]], "clock":"8", "rotate":true};
				const confetti = new ConfettiGenerator(confettiSettings);
				confetti.render();

Is this problem related?
https://gamedev.stackexchange.com/questions/37298/slow-firefox-javascript-canvas-performance

@arutinn
Copy link

arutinn commented Jul 31, 2020

Still an issue 😢

@petabite
Copy link

Hey i noticed that you're using custom confetti particles as well. Could your issue be related to what I'm experiencing in #26?

@userexec
Copy link

We fixed this for a promo by adding a frame limiter to the animation loop and capping it at 30fps instead of whatever Firefox was willing to hand over to it. Line 210's call to requestAnimationFrame just needs to be wrapped in a setTimeout.

@userexec userexec linked a pull request Oct 16, 2020 that will close this issue
@enrickla
Copy link
Author

enrickla commented Dec 8, 2020

Ohh great, I will test that! Sorry for the late reply!!

m1foley added a commit to m1foley/mahjongwind that referenced this issue Feb 28, 2021
Took someone's Frankenstein branch:
https://github.com/DreamTeamMobile/confetti-js/commits/svg-preload

Fixes both these issues, which the maintainer hasn't gotten around to
merging:
Agezao/confetti-js#23
Agezao/confetti-js#26
@jrmuizel
Copy link

jrmuizel commented Feb 3, 2022

@enrickla do you see the same problem on https://agezao.github.io/confetti-js/? If not can you provide a URL that shows the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants