PrimaryFeather/Starling-Framework — pull request #382 by rzubek (2013-08-10 20:58:09+00:00)
Title: Added support for Domain Memory and fast memory access

I added support for using Domain Memory, and the fast memory access opcodes, in the byte array version of Starling. The pieces include:

- Converted all individual VertexData classes to all use a single global ByteArray, instead of many separate ones
- Wrote a memory allocator that gives each VertexData a chunk of the global array, and manages operations such as allocating and freeing memory chunks, growing already allocated chunks, and growing the global heap automatically.
- Converted all byte array accesses to use the fast avm2.intrinsics.memory operations

I've benchmarked using the built-in Starling-Demo-Web benchmark, and the difference is startling:

Before: 890 objects in debug mode, 7870 in release mode
After: 1050 objects in debug mode, 12500 in release mode

In fact this is more than a little surprising, I'd appreciate a second set of eyes on this.

Please let me know what you think. I'd be happy to comment and clean up more, to make it more production ready.