boostworthyisryantaylor

AS3 Turbo: 16,000 Sprites @ 44fps

As you have probably seen by now, Moses Gunesch (creator of FuseKit and Go) released a very nice utility awhile ago by the name of TweenBencher for testing animation performance. My animation system performed decent considering it's list of capabilities and architecture, however it leaves something to be desired for those in need of extreme performance and/or small file sizes.

The project I am working on at Schematic right now is an excellent example of this need. Since there are thousands of components on screen inside a SWF which spans anywhere from 1000 to 10,000 pixels tall and thousands of lines of compressed XML data are being polled every 30 seconds, performance is a big deal. In order to successfully animate large quantities of sprites in an application as aggressive as this one, I set out to create a new variation of my animation system, which I have dubbed Turbo.

Turbo is the fastest AS3 animation system to date, rendering the 16,000 sprite test in TweenBencher at a blazing 44fps - that is 27fps faster than Go and even 3fps faster than the simple AS3 benchmark test it uses. These numbers were generated on a 2.4ghz/4gb MacBook Pro.

Benchmark results: (Boostworthy) AS3 Turbo
------------------
125 Sprites :: Start Lag: 0 seconds :: FPS: 98 :: End lag: 0
250 Sprites :: Start Lag: 0 seconds :: FPS: 99 :: End lag: 0
500 Sprites :: Start Lag: 0 seconds :: FPS: 99 :: End lag: 0
1000 Sprites :: Start Lag: 0.01 seconds :: FPS: 99 :: End lag: 0.01
2000 Sprites :: Start Lag: 0.01 seconds :: FPS: 89 :: End lag: 0.02
4000 Sprites :: Start Lag: 0.03 seconds :: FPS: 77 :: End lag: 0.08
8000 Sprites :: Start Lag: 0.08 seconds :: FPS: 60 :: End lag: 0.11
16000 Sprites :: Start Lag: 0.21 seconds :: FPS: 44 :: End lag: 0.22

PLEASE NOTE: Though I mention numbers in comparison to Go, this is not a competition by any means. I simply use Go as reference because it is the fastest system prior to Turbo. I am collaborating with Moses on Go as well.

For those currently using my animation system, the idea is to combine the best pieces of the AnimationManager and Timeline into one super fast, extensible package. Here is an example of the syntax I am using at this time:

ActionScript:
  1. // object, property name, property value, duration (milliseconds), easing equation, delay
  2. animationManager.addAnimation(new Animation(box, "width", stage.stageWidth, 2000, sineOut, 0));

Turbo is still very much a work in progress, however I would like to begin getting it into peoples hands for feedback and testing in the near future. If you are interested in learning more about Turbo or would like to participate in the feedback and testing phase, please let me know.

26 Comments so far

  1. Amit February 18th, 2008 7:45 am

    Hi there!
    I was wandering if your animation package can animate properties of the graphics api (in as3) for the lineTo or curveTo methods over time.. if it is possible I would love to give it a try! as far as my investigations around I couldn't find one that does it.
    Thanks,
    A.

  2. Andy One February 18th, 2008 7:46 am

    Cool!

  3. Nicolas February 18th, 2008 8:46 am

    Sounds awesome! I would love to help with the testing if possible.

    -Nick

  4. Theun de Bruijn February 19th, 2008 4:55 am

    Indeed, this seems like a wicked piece of code.

    I'd love to assist with testing / debugging when your test version is ready for release.

    Keep up the awesome work!

    -Theun

  5. Ryan Taylor February 19th, 2008 11:39 pm

    @Amit - Not at the moment, though that is certainly doable. I'm taking note of that as a potential addition.

    @Nicolas, Theun de Bruijn - Thanks, I'll be contacting you guys in the near future when things are ready for testing.

  6. Glenn Williams February 20th, 2008 5:46 pm

    Sounds really interested mate.

    I'd love to hear more, and help you with testing when you're ready.

    drop me an email anytime.

  7. Yotam Laufer February 21st, 2008 4:06 am

    Hi,

    I've been using Animation Package which was great, I'd love to test Turbo.

    Thanks!
    `
    Yotam.

  8. Chris Taylor February 21st, 2008 12:36 pm

    This sounds amazing! I have a project right now that's loosing frame rate on some animations and would love to test this out to see if it would help. Does it have built in support for blurs like your AS3 animation system? So yeah, if you want someone to test, let me know.

    Chris

  9. Ben February 26th, 2008 1:48 pm

    Sick work.

  10. Thomas February 27th, 2008 10:20 am

    Turbo seems to be exactly the right name if the stats don't lie! :) I'm also very interested in seeing demos and/or doing some tests with your code on my own, so I'd love to be on your list of alpha/beta testers.

    Thomas.

  11. Mims H. Wright March 2nd, 2008 1:05 am

    Hey Ryan,

    I'd love to talk to you about how to achieve that kind of speed with your engine. KitchenSync is definitely lagging behind some of the other systems in the performance department (literally).

    Mims

  12. Ryan Taylor March 4th, 2008 3:48 pm

    Hey Mims,

    Yep, I've been meaning to get back to you about KitchenSync, but I have been super busy these past few weeks. I'll be in touch soon.

  13. kyle March 5th, 2008 3:20 pm

    Hey Ryan,
    i'm down for testing this aswell.
    We talked earlier through email about this.
    Thanks!

  14. Erik Lembke March 6th, 2008 10:46 am

    Hi Ryan,

    sounds fantastic. As already mentioned I tried some customizations on the latest release (e.g. Timeline.removeTween() and also the TweenStack). I love the functionality of the "virtual" timeline and looking forward for the "turbo" update.

    I would be very interested on testing.

    Thanks,
    Erik

  15. Ben March 6th, 2008 6:22 pm

    Ryan,
    Will Turbo only support single properties per tween? Or will it be possible to tween width, height, and coordinates with a single tween similar to that of Tweener and TweenLite?

    Thanks,
    Ben

  16. Ryan Taylor March 7th, 2008 12:32 am

    Hey Ben,

    Good question - Turbo will include animation types for handling both single and multiple properties, that way you can use choose the one that fits your needs best.

  17. matt March 16th, 2008 7:13 am

    sounds good. Im using boostworthy for all my animation. please sign me up to the beta.

    cheers,

    MaTT

  18. Ryan Taylor March 16th, 2008 9:14 pm

    @Matt - Thanks, you have been added to the beta list as well.

  19. Ryan Taylor March 16th, 2008 9:16 pm

    Just a general update for everyone who has requested to be involved in the beta program - my progress has been slowed down quite a bit due to some big project deadlines that are quickly approaching. I will keep you all informed and get a version out to you as soon as I can. Thanks everyone!

  20. Jonas March 18th, 2008 10:59 am

    Hi, also interested in joining that list!

    Awesome work dude, assisting in creating a better world through experience :P

  21. Aaron March 23rd, 2008 1:00 pm

    Indeed, I am also interested. Please add me to the list as well. ;)

  22. noah April 8th, 2008 9:20 am

    Hey Ryan. Those numbers look phenomenal! Please add me to your list of beta testers if possible.

  23. Patrick Jankun April 30th, 2008 3:00 am

    I would be happy to get some turbo charged animation under the hood of my flash

    great job Ryan, and the numbers look very well!

  24. thienhaflash September 16th, 2008 11:34 pm

    Hi, Ryan.

    I'm currently use my own KTween which is a bit faster than the famous TweenLite (which is the fastest engine i know).

    It's really interesting founding your engine. May i take a seat on the drive through your tweening engine?

    It's would be very great if i can take part in you work.
    Please add me in for testing...

  25. Jan Jansen April 4th, 2009 8:51 am

    So Ryan,

    How is this turbo engine doin?
    I'm using the animation system right now that you've also made, but am really interested in the turbo boost you promise performance-wise. So what up? it's 2009! ;)

  26. Ryan Taylor April 12th, 2009 11:54 pm

    Jan - Haha, thanks for calling me out on that. :-) It is still on my long list of things to finish, I just keep getting sidetracked by other projects and stuff. I will try my best to wrap it up by this summer!

Leave a reply

*
To prove you are human (not an imperial spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word