Search code examples
apache-flexflashflex3adobealchemy

Why does the Adobe Alchemy Tool create faster running flash byte code than the flex compiler?


I have seen a few blog entries on this and have had a discussion or two with my team mates but I would like to see what the stack overflow community thinks.

So why does the Adobe Alchemy Tool create so much faster running flash byte code than the flex compiler?

Also, when will the flex compiler be able to make similar performance gains?

Will it require programmer specific use of special Array's or something of that nature to get the same performance?


Solution

  • Alchemy is an implementation of LLVM in ActionScript. Simply put, it's an virtual machine that uses a ByteArray as it's memory store.

    The C code compiled by Alchemy has direct access to "memory" (via some opcodes introduced in Flash 10), allowing it to chunk memory around at it's leisure (including pointers to objects). This results in some, but by no means all, code running faster. Some types of code will actually run slower in Alchemy due to it being a VM running on top of the AVM (another VM).

    Additionally, Alchemy does not have native access to ActionScript classes and must access them through interop classes.