Jump to content


TweenLite TimelineLite garbage collector

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts



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.




Link to comment
Share on other sites

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)

  • Like 3
Link to comment
Share on other sites

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.





  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.