DragonBones / DragonBonesAS

DragonBones ActionScript Runtime
MIT License
250 stars 117 forks source link

Performance optimization #61

Closed freem-trg closed 8 years ago

freem-trg commented 9 years ago

-remove unnecessary memory allocation -use the difference between two numbers instead of toFixed(4)

For tests i take Example_PerformanceTesing sources and replace FastArmature -> Armature Not optimized flash: 29 armatures 522 bones [Adobe Flash Player 18.0.0.209] 35 armatures 630 bones [Google Chrome Pepper Flash Player 18.0.0.232] After the optimization: 103 armatures 1854 bones [Adobe Flash Player 18.0.0.209] 180 armatures 3240 bones [Google Chrome Pepper Flash Player 18.0.0.232]

All builds with the same build options (release build, inline = true, optimize bitecode = true)

Update: made some more optimization: -remove creation of new Object each time DBOject.calculateParentTransform method called by using pool of objects (see below) -add new class ParentTransformObject for store the results of the parent transformation (instead of using raw Object) After the optimization: 113 armatures 2034 bones [Adobe Flash Player 18.0.0.209] 218 armatures 3924 bones [Google Chrome Pepper Flash Player 18.0.0.232]

superlancelot commented 8 years ago

That was amazing!!!!!!

freem-trg commented 8 years ago

Thank you! :)

freem-trg commented 8 years ago

Will you merge this changes into the project?

sucresk commented 8 years ago

thanks a lot, we merged it