lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Alchemy works by translating C/C++ code to ActionScript through a LLVM compiler which instead of producing machine or bytecode produces ActionScript.  The translated C/C++ code uses a big ActionScript ByteArray as the C/C++ heap and stack.  The performance of alchemy is slow if you martial data from C/C++ code to ActionScript or back but faster (supposedly up to 10 times faster) than ActionScript code you write yourself for data intensive actions where everything operates in the C/C++ memory space - speed improvements over AS code are also due to LLVM doing code optimization which is missing from the normal AS compiler.

All that said, the Lua code is sloooooowwwww by comparison.  This is really noticable when running life.lua - it takes 4 seconds to run with standard Lua and 13 minutes with ActionScript Lua.  There is a great deal of data marshalling going on to print out the results each evolution.    I may tweak the script to skip printing and see how fast it is without marshalling.

But I'm not too disheartened.  Alchemy is in beta so some improments should come if Adobe continues down this path.  Also for the purpose I wanted - adding some scripting to my Flex applications mainly to dynamically create or control AS objects - it should be plenty fast.  Worrying about speed for what I want is a bit of premature optimization.


On Wed, Dec 3, 2008 at 2:44 AM, steve donovan <> wrote:
On Wed, Dec 3, 2008 at 6:54 AM, Robert Stehwien <> wrote:
> I just made my first foray into Lua by using Adobe's Alchemy C/C++ to
> ActionScript compiler to write a proof of concept embedding Lua into Flash.

Would be interesting to know what the performance of Lua would be
given that the Lua VM would be running on the Flash VM.

steve d.