frameworks

The TLF framework is a good example of the current status quo regarding native implementations vs. AS3 frameworks at Adobe. Adobe is implementing core functionality (layout of text) through ActionScript Framework and not as a native implementation in the Flash Player. Sure, you have the low-level text engine classes and API that lets you actually use of low-level layout and rendering, but Flash has for a long time implemented high-level API’s.

Following are the advantages and disadvantages of using Frameworks vs. native implementations:

Advantages:

  1. Updatability. You don’t rely on Flash Player updates to deliver new functionality or bug fixes.
  2. The Flash Player download size does not increase

Disadvantages:

1. Speed. If you remember my recent post on our AS3-2-Java compiler, the same code ran 800 times faster in Java than it did in the Flash Player using AS3. So expect things to run three times slower.

2. Bloat. The framework takes a chunk of bandwidth for every piece of SWF that uses the framework, as it’s embedded in each and every SWF that uses is (yes, there’s of course the framework cache, but still, cache misses are currently more frequent than hits)

In this example the bad clearly outweighs the good. Now fast forward to the days of Flex. The CPU screams for help when you pile hundreds of components on your screen. If you inspect your List-based components you tend to get dizzy with the number of UIComponents flying around. Not only is there one for each base component, but with Flex 4 you’re essentially doubling the number of UIComponents on screen as all of your skin files are based on UIComponent.

It would seem logical for me to just implement the UIComponent natively as it does so much of the apps work (measure, layout, validation, focus & input management and whatnot). At least it would be an interesting experiment on how much every Flex app would gain from a native implementation of the UIComponent (oh, and while you’re at it, put in a native implementation for Group and Graphic Element as well).

The last speed increase of any magnitude was revealed by the Player team at Max2006 in 2006. We need an encore! Only this time, please make two orders of magnitude.