Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between TweenMax & TweenLite?

Is there any speed or Garbage Collection difference between TweenMax & TweenLite ?

Actually currently i'm working on site in which i'm using more than 500 tween with TweenMax , and site works perfectly in firefox but in chrome and safari tween lag very badly.

Difference between TweenMax & TweenLite based on GC & speed ?

like image 762
Dhaval Panchal Avatar asked Jul 29 '14 05:07

Dhaval Panchal


People also ask

What is the difference between TimelineLite and TimelineMax?

From the docs: TimelineMax extends TimelineLite, offering exactly the same functionality plus useful (but non-essential) features like repeat, repeatDelay, yoyo, currentLabel(), addCallback(), removeCallback(), tweenTo(), tweenFromTo(), getLabelAfter(), getLabelBefore(), getActive() (and probably more in the future).

What is TweenMax in Gsap?

A tween is a single movement in an animation. In GSAP, a tween has the following syntax: TweenMax.method(element, duration, vars) Let's take a look at what this syntax represents; method refers to the GSAP method you'll like to tween with. element is the element you want to animate.

Is Gsap TweenMax free?

For the majority of use cases, GSAP is totally free to use. As Craig pointed out, TweenMax, TweenLite, TimelineMax, TimelineLite, a bunch of plugins, and most eases are free to use unless you need a business license.

Can I use Gsap for free?

GreenSock's standard "No Charge" license is very permissive (it even covers most commercial uses.) However - If your GSAP-enhanced site/product generates a fee from multiple users (including micro-transactions, subscription fees, etc.), it requires the commercial license which comes with Business Green memberships.


1 Answers

It's highly unlikely you'd notice any performance difference between the two, but technically TweenLite is very slightly faster (again, I'd be shocked if it's even slightly noticeable) only because it doesn't have to accommodate quite as many features (like repeat/yoyo). TweenMax has a few more properties, so instances take up a bit more memory. Again, not significant. Both are super optimized for performance and GC shouldn't be an issue for either one.

In the VAST majority of cases, performance problems have nothing to do with TweenLite or TweenMax - it's graphics rendering in the browser that takes exponentially more horsepower to complete. In other words, JavaScript execution is a small percentage of the overall CPU/GPU drain. You might want to try setting force3D:true on tweens to force the target onto its own GPU layer.

My guess is that your Chrome/Safari issues are unrelated to TweenLite/TweenMax but I didn't have time to do a full analysis of your link. I saw that you have some pretty huge "composite layers" events (in excess of 60ms) in the Chrome Dev Tools timeline. The actual JS execution (which is what TweenLite/TweenMax do) looked plenty fast.

like image 83
Jack Avatar answered Sep 30 '22 17:09

Jack