Skip to main content
Inspiring
February 26, 2015
Question

Any plans to improve AS3 performance?

  • February 26, 2015
  • 1 reply
  • 1350 views

Lately I've been experimenting with porting my chess engine (SparkChess) from AS3 to Javascript via TypeScript.

The app has been in development for 6 years and its AS3 performance is fully optimized. All important functions were benchmarked and analysed at bytecode level, I discussed performance tips with Adobe engineers and I tested various approaches to find the fastest way.

I was quite surprised to see that the Javascript performance in Chrome is almost double than AS3. It starts slower but after a few iterations, the speed increases dramatically.

I'm not publishing numbers because it's not a 1:1 test yet, but the results so far are consistent.

Of course, Javascript has a number of disadvantages - Canvas-based UI is a kludge, script execution timeout varies across browsers and it's difficult to control (the engine needs time), support for some modern features is limited to newest browsers, code and assets are easy to steal, etc. A JS-based SparkChess would be a step backwards.

Still, I'd love to see some visible speed improvements in AS3. I know VM design is hard, I just hope there's still enough interest at Adobe in this area.

This topic has been closed for replies.

1 reply

ArmandNAuthor
Inspiring
February 26, 2015

The final results are in.

I conducted a full deterministic 1:1 test, making sure that at every step the values are the same between engines.

Javascript in Chrome 42 is 254% faster than Flash Player 14.

My test uses a lot of Vector.<int> reading, bitwise operations and of course recursivity, but there's no complex Math functions involved.

natural_criticB837
Legend
March 3, 2015

As far as I know, Chrome precompiles Javascript in the background, you will not be able to achieve that speed in ActionScript.