I wrote a while ago about our tween engine at Hobnox but I did not post any performance demos.
Here are the results for 1000 DisplayObjects with manipulation on their scaleX, scaleY, alpha, x, y and rotation properties. It is also very important that you take a look at the memory behaviour. A click starts the tweening.
As you can see it makes a lot of sense to stay type-safe and to manage the memory you are using on your own.
I will talk about those concepts in my next session AudioTool’s Private Parts in Brighton and Boston. Since optimization on a code level is trivial the main performance boost is achieved by re-thinking algorithms, structures and concepts. I guess one of the most interesting topics will be the optimization of our cable solver which was running O(n^2) (really!), then O(n(n+1)/2) and could be minimized to a rare O(n(n-4)/2) worst-case.




I am not seeing any major difference between the three url’s. I start a new safari instance each time to get the proper memory value for each url independently.
What are your results?
I personally don’t think speed differences above 100 tweening objects isn’t that much important for everyday use. More important is elegance of use, flexibility and adaptability.
It depends what you have to do. For us the most important thing is having a good memory management.
You often do good conferences, but you never post on your blog your readings. It could be really interesting.
Getting more speed (and more efficient use of memory) should interest any serious Flash developer! Sadly all 3 demos link to pure grey pages with no content, and nothing runs (tried in Chrome and FF3, I refuse to lower myself to seeing if it’ll work in IE). So I guess I’ll never really know if this is any better or not :)
You need FP10.
Nice - consistently 5fps faster than Tweenlite (10 faster than gTween) and about 5mb lighter on my crappy laptop. Any chance that code is ever going to see the light of day?
Nice - runs 5-10fps faster and about 5mb lighter on my crappy laptop. Any chance that class will ever go public?
I did create my tween engine, and for my test, it also run faster than tweenlite about 5-7 frames/second (i used Jack at Greensock’s AS3 speed test to plug my engine in)
I did read the object-pool algorithm and found it really interesting, but i haven’t apply it to my tween engine. I think it will help decrease the time to create a new tween but won’t boost the tweening progress…
I just wonder why you need flash player 10 to test the 3 tweening engines here? And, can i get you tweening-speed test file so i can make a test for my self? I am not very good at algorithm and also not good at coding so may be if i use my tweening comparision it won’t give the correct results…
i wrote my own tweening engine and for my test it also run a bit faster than tweenlite (3-5 frames/second). I used Jack’s testing engine (at greensock)
I did read your post about object-pool algorithm and found it really interesting but i haven’t applied it to my tween engine yet. It will boost the init tween only i think, for the tweening it has no effect.
I just wondering why you need flash player 10 to test these three tween engine here. And if i can get your source file of testing to test my own engine? Because i’m not very clever at algorithm and coding so if i write a testing file it won’t get the right result or can i give my engine to you and you will plug it in to test?
Thanks for your post… it’s really help much. I’ve read much about code optimizing and just wondering whether any other things to aware of while optimizing code (algorithm way) like object-pool?
@thienhaflash: If you manage the memory yourself you will not get that many GC activity. I tween 1000 objects each second. So the GC is noticeable (especially for TweenLite). GTween for instance has already better memory management than TweenLite but you would notice it only if the whole engine would run faster.
I will definitly post the slides for FOTB/FOT so you will find some ideas there. Typically we have a lot of very specialized data structures where we moved from a highly optimized red-black tree implementation to a very specialized linked-list (it has some sort of cached lookup) in one case and it boosted performance a lot. So what ever you do in most cases it is a very individual optimization you can do. Applying rules for code optimization is simple but optimizations on a structure level are always a hard task.
You need Flash Player 10 because I compile only for Flash Player 10. The tween engine is written for Flash Player 9 and it would not change for 10 because no Array I could convert to Vector is used.
The difference is quite clear here! Nice job! Any plans to make the engine available and how do all these engines compare to Tweener? (stop throwing your shoes at me!!)
I think Tweener was slower than the all three engines. I think I have tested it but it is already slower than GTween.
Joa you said “For us the most important thing is having a good memory management.”
Hobnox memory test : 43 Mb (stable)
GTween memory test : 45 to 48 to 45 to 48… Mb
TweenLite memory test : 46 to 48 to 46 to 48… Mb
The diffence between the 3 engines is the stability of the memory usage. But the amount of memory used is not very different.
Can you explain what you like in the memory usage of the Hobnox engine, and why ?
What is the impact of a memory that moves permanently to a few Mb ?
Thanks
first to say, I don’t have fp 10 installed and I don’t see anything until I use the absolute swf path to the tests. (e.g. http://www.joa-ebert.com/files/swf/tween/Hobnox.swf)
on the other hand chrome needs more than 40 mb to display the animations - compared to about 8 to 10 mb in firefox?! heavy difference…
oh… maybe it’s because of the minimum required player version specified in the swfobject?
I wanted to make a comparison between theese tween engines and mine , but you haven’t posted a link to the source of the test , so i made a similar test , the tween engine have the same options as fl.transitions.Tween , only it is faster http://78.90.132.113/many/
Hey Joa, is i possible to get the FLA used for this test?, I have a few tween engines of various approaches, both of which should be solid in memory as I don’t create or destroy objects typically, I also use strong typing, but I’d like to make sure and see how they compare.
Just create 1000 shapes and create a function to tween their x, y, alpha, rotation, scaleX, scaleY with random values. Call that function again when the tween is complete.