GreenSock


Speed Test - Tweening Engine Comparison Tool

Posted in Tweening by jack on the October 22nd, 2007

On the heels of releasing a new version of TweenLite and TweenFilterLite and investing a lot of time into optimizing performance, I figured I'd take a few minutes to throw together a tool that could demonstrate and quantify any speed differences among a few of the tweening engines out there. Now before you go writing nasty comments about the fact that I didn't include your favorite one, I KNOW! I just didn't have time to download them all, learn the syntax, and include them. Instead, my goal was to post the tool and let the Flash community add to it if they so desire. It should be pretty simple actually. Dowload the source file here: AS2 or AS3. No trickery involved; the same code drives everything except for the tweens themselves. Basically it tweens white "stars" from the center outward at random angles, sizes, and with random delays. When a star's tween ends, it just repositions itself at the center and starts again. You can play with the number of stars and the duration of the tweens to see how the tweening engines handle various types of loads.

Oh, and if you want to see the bezier tweening speed test, click here.

So to kick things off, here's a comparison of Tweener, TweenLite, ZigoEngine (Fuse), Twease and Adobe's built-in Tween class: (select a tweening engine and click the "START" button)

And here's a similar AS3 test. Keep in mind that AS3 runs in the MUCH faster AVM2, so I kicked up the instance numbers to keep it challenging.

I haven't seen any visual/interactive speed comparison tools out there, so hopefully this is helpful for someone.

13 Responses to 'Speed Test - Tweening Engine Comparison Tool'

Subscribe to comments with RSS

  1. Zeh said,

    on October 21st, 2007 at 4:39 pm

    Interesting comparison tool. I’ll cross-post what I’ve said on the Tweener mailing list, with some minor additions:

    (…) It’s curious to see (from what my own benchmarks) that the impact on Tweener’s execution is more related to some very specific features - some options/features such as rounding values, some security checks as checking whether the object (still) exists or not during a tween, and specially, verifying whether a tweening already exists for a given object when a new tween is added - then the actual number of features. Verification of existing tweenings (that should then be overwritten) is what causes the biggest disparity in results I believe, so if you compare them with longer tweenings (ie, 10 seconds) then it’s a raw check of *updating* speed and the result (for all) is a lot closer.

    But it shows that there’s some room for improvement for Tweener, I suppose.

    While the current beta version has some fixes already (the one used on the test is the latest ’stable’ one, before a few minor changes for speed) hopefully the current version I’m working on will be faster by breaking it in more classes, while also making some of those additional security/redundant checking optional since sometimes it might not be what people want.


  2. on October 21st, 2007 at 6:00 pm

    Hey Jack nice test, it appears TweenLite scales pretty well. I wonder the performance of the AS3 kits comparisons as AS2 is really a dog compared to AS3 AVM2 virtual machine.

  3. jack said,

    on October 22nd, 2007 at 12:29 am

    Yep, the verification of existing tweens (and overwriting them) was a huge bottleneck in older versions of TweenLite too when doing tons of instantiations. The new version still has that feature fully intact (overwriting existing tweens of the same object) - I modified the lookup strategy so that it’s MUCH faster now, especially for MovieClips.

    Zeh, Tweener has a huge following - you’ve done a great job building a full-featured tweening engine and it’s an honor to have you post here. I also admire your open and humble attitude about the various tweening engines available. If you’d like to drastically speed up Tweener’s verification routines, feel free to use my code (if it fits well in Tweener).

  4. jack said,

    on October 22nd, 2007 at 10:59 am

    Ryan, I just posted an AS3 version of the speed test too. You’re right - the AVM2 is MUCH speedier but you can still see some difference in the tweening engines when you crank up the number of instances and lower the duration.


  5. on October 22nd, 2007 at 1:12 pm

    Thanks for the update Jack, yes when AS3 comes in the threshold is much much higher and even a bit more level in terms of the animation kits. AS2 is such a dog I am not sure why it is hanging around being so slow :). Thanks for doing this it helps to speed things up when performance is highlighted and I think that we probably need a continual performance test of all anim kits much like bubblemark or comparisons of jquery, mootools, prototype etc.

    Anything measured improves. Thanks for doing the AS3 version so quickly. It becomes another tool to show how much AS3 has surpassed AS2 in teh new AVM2 and how tight performance issues in AS2 become much higher thresholds in AS3. It still highlights a slow down in Tweener compared to TweenLite but there is some overhead in Tweener that is being worked on. I think this can only improve all animation kits when this is highlighted.


  6. on October 22nd, 2007 at 8:43 pm

    Jack, great work and the stars must have been in alignment – this is super bizarre but I just posted a benchmarking utility myself, tonight as well! (Have been working on it for a week or so.) I hope it’s okay to post a link to it here, I certainly don’t mean to detract from your great work here at all… if it’s nothing but a big party then here’s mine:

    TweenBencher: http://go.mosessupposes.com/?p=5

    Yes AS3 just rips, it is incredible. I am able to run over 30,000 animations on a very normal computer system, whereas in AS2 about 400 and the player was toast.

    I also wanted to say that I admire your work with TweenLite. My big thing is that we need to be looking at things from a marketplace perspective, and working to fill gaps and real needs. A low-filesize tween engine is by far one of the top requests I got for Fuse (I tried for a while early on but threw in the towel on that), and you’ve done a marvelous job with it. Kudos.

    While I have the floor I also want to be sure you all hear my recent call for an Open Standard for AS3 animation systems. I am leading a community initiative to create such a standard now called Go, more info at my blog. In short the idea behind Go is that less is more, modular and flexible are good, while dumping too many top-to-bottom animation solutions into the marketplace may be leading us down a less good path. In regards to how much management slows engines down as in Zeh’s post above, Go answers this by making all mangement 100% opt-in use.

    I would like to promote making animation scripting accessible for all AS3 developers, and think it would be neat if all of these systems can work together without too much redundancy.

    Also just to clarify, having lots of tween engines out there is certainly not a bad thing at all – It is a great and healthy thing indeed, as there are lots of needs and niches to address. What can potentially be less than good is when each solution is built differently from the ground up with nothing in common and no easy way to synchronize them.

    Thanks again for your great work Jack!


  7. on October 23rd, 2007 at 3:17 pm

    I suppose I should post too since my engine is the last one up there eh?

    First I want to say I admire all of the various engine developers for their work and openness. Different developers that make high-quality tweening engines is a great thing. The inspiration from each other’s work actually helps make them a bit more unified and really lets the developers make each one as best as possible. Each one, like everything, has it’s strengths and weaknesses, but with ideas taken from each engine, essentially makes each stronger.

    I’m sure each one of us wants ours (and each others) to be the best they can be, so benchmarks like these, I’d say, pushes us to make each of ours better, as Ryan mentioned. This ultimately creates a better experience for the developers who use them, and especially the end user. And isn’t that what it’s all about?

  8. jack said,

    on October 23rd, 2007 at 10:54 pm

    Moses, wow, this is so weird having you, Zeh, and Andrew all post comments here. I’m very honored. Seriously, you’ve put a ton of work into Fuse and it’s quite obvious. On behalf of the Flash community, thanks. Same to you, Zeh and Andrew. I’m encouraged by the humble, open posture you all hold, and the desire to freely share your code which will in the end produce better solutions for everyone. As I’ve said before, feel free to use any of the strategies you find useful in TweenLite.

  9. judy said,

    on November 10th, 2007 at 9:53 pm

    Man, many times during the routine work day I end up dealing with these old guys who are paranoid and won’t let me even look at their code even though we both work for the same client and I have absolutely no interest in nicking it for my own use whatsoever, even if I did have a need for it…

    Open source and open minds forever. Too bad most of the world doesn’t feel the same way.

  10. Billy said,

    on December 6th, 2007 at 8:28 pm

    Hey Jack, Nice work, actually I like all your guys work, I was wondering if you could at all update the AS3 bencher with some of the other engines out there. Maybe some from Tween Bencher. Both comparison tools are nice, and would like to see how your tool works with them to. Thanks!

  11. jack said,

    on December 6th, 2007 at 9:12 pm

    Thanks, Billy. Actually, I’d love to add more tweening engines to the AS3 comparison tool, but I’ve been slammed with work lately and just don’t have the time. I posted links to the source code, so you’re welcome to add them yourself. If you do, please send me your files so I can post them for everyone to benefit from. I hope to eventually whip together a bencher for filter tweens too, but again, I only have so much time in the day and I’ve gotta pay the bills :-)


  12. on January 13th, 2008 at 8:10 am

    This is really useful thanks, also shows how much better AS3 performs

  13. zedia.net said,

    on January 21st, 2008 at 7:36 pm

    I had some trouble at first with TweenLite, but I have been using it for a while and I can say that I love it. The speed and size is just amazing and this is exactly what I am looking for in a Tweening engine. GOASAP looks good and I will surely give it a try, but if you don’t want to build your animation package TweenLite is the way to go.

    Great job!

Leave a Reply