actionscript 3 - Flash optimisation confusion -
i'm new actionscript (v3), 20 years c++ though, , i'm trying head around of performance caveats i'm reading.
i checked out site:
http://www.nbilyk.com/optimizing-actionscript-3
and scared death of 'code' section saying actionscript has dynamic lookup when trying find static methods in package. point being inefficient put util-type functions (typically math functions) in own package static functions, because has lookup namespace , method dynamically each time call it.
is true? it's not expected, coming c++, , changes how structure code , libraries. wonder if it's better have singleton util library new()'d once, containing methods normal public methods, have them static in package.
are there other obvious gotchas this?
cheers,
shane
yes true. calling static functions outside class slow. tested myself, on 10,000 iterations 220ms static vs 160ms calling function on instance.
other tips avoid adobe compiler. have started using haxe converts llvm , abc code (actionscript byte code). there hidden opcodes dealing memory haxe takes advantage of (same alchemy).
speaking of alchemy compile c++ --> llvm --> abc. might useful if have lots of c++ libraries. (someone ported doom, hexen, , heritic on flash way)
edit: performance related http://lab.polygonal.de/ , http://blog.joa-ebert.com places start.
Comments
Post a Comment