Jump to content
Search Community

TweenLite TimelineLite garbage collector

gilloub test
Moderator Tag

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

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 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

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.
×
×
  • Create New...