Share Posted January 13, 2016 Hello, I used TweenLite and TimelineLite for a game project based on pixijs for graphics part. I did memory test on chrome and realised that when I create use tween / timeline for my sprites I have have leap sawtooth. Is there any pooling mecanism in the lib in order to reuse the tweens when there animation is complete. Cheers, Link to post Share on other sites
Share Posted January 13, 2016 I've done a lot of testing and research on the whole "reusing objects to alleviate garbage collection" and there are a ton of misunderstandings around that. It sounds really good in theory but in reality there can be some heavy costs because you must "clean" those objects which eats up resources and can actually be more costly performance-wise. Also, it can be problematic in an object-oriented framework where people may hang on to tween references so that they can restart() them later (or whatever) and if you reuse objects internally, it can mess that up (your tween instance might get re-used underneath you and you'd be restarting a different animation altogether). So ultimately I found that the current model we use is actually better for performance overall. And that's your bigger goal, right? (Performance) 3 Link to post Share on other sites
Share Posted January 13, 2016 Just to add my 5 cents.. Keep in mind when doing performance or memory tests in Chrome with Chrome Dev Tools. That you must be in a private window (incognito mode) to test in. The Chrome Dev Team recommends this so you don't skew results. https://developer.chrome.com/devtools/docs/javascript-memory-profiling 2 Link to post Share on other sites