-
Notifications
You must be signed in to change notification settings - Fork 113
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
Group.removeEmitter Performance #124
Comments
Ah, good find! I'm sure you can figure out what that code is doing (and why I thought it necessary). I'll experiment with some perf improvements and do some profiling. What's the longest you'd like it to take (on your current setup?) I'm assuming less than 1 frame, so 16ms at the abs max? |
I'm assuming that the code removes the buffer attributes from the particle group. So huge memory and rendering advantage to remove them. Hmm, tricky as the operation needs to happen quite quickly, sometimes up to 30 emitters with roughly 300-400 particles per emitter get removed. I suppose I could just stagger the removal of the emitters, set up some sort of garbage collection. Hmm... |
@titansoftime Do you have an example of your use of this lib so I can try to reproduce it? Or could I just create 30 emitters with 300-400 particles and add/remove them to reproduce? |
Sorry, I've spent the past few days moving. I will get an example fiddle up asap. |
And finally. http://jsfiddle.net/titansoftime/gazta474/ [edited to fix some migration issues] |
Awesome, thanks @titansoftime. I'll have a look as soon as I can! |
I have a particle group with 80 emitters attached (clouds). After an emitter has existed for about 3 minutes I remove the emitter. Unfortunately each
Group.removeEmitter
call takes between 200 - 300ms on my 3 year old desktop. This of course freezes the app.This is the culprit code (line 2260):
I can just comment this out and all "seems" fine, though I'm sure there is a resulting memory leak (haven't tested).
The text was updated successfully, but these errors were encountered: