Recently I’ve been spending a chunk of time looking more into the RIA space and what oppourtunities there might be to bring some apps up-to-date, and there’s one thing I have noticed which kind of bugs me a little…
The thing is to do with the startup times of a typical flex application. Note that I am talking about apps here, not widgets etc, just anything with some sort of substantial size to it. For me, the startup time kinda kills the flow of the site that you are on (assuming you are on a site of course), forcing you to have to sit and wait while something happens. Now this isn’t normally a problem with AJAX or similar due to it’s progressive loading, but Flex appears to need to load itself in completely before it can start doing anything.
Now, if we look at this as part of AIR, Flex makes perfect sense. It means I can use web skills to produce a desktop app, that looks and works like a desktop app might, and because you start the app locally, the startup lag is kind of expected somewhat.
So, is Flex just better in an AIR context, or am I just being a little picky (I have high standards you know)…


As a flex developer you have options to reduce the initial wait time. For example, breaking the application into modules will allow each to be downloaded on demand. This reduces initial load time and has the added benefit of saving bandwidth since if a user only uses part of your app, you only need to send that part over the wire.
To say that AJAX apps don’t have this problem is not necessarily true. If you are doing something where the layout of the screen is based on widgets, you will most definitely have an initial wait as the HTML renders in the browser and then the Javascript parses and rearranges it. Take a look at the initial load of a very complex app built with Dojo or YUI for example.
Not to mention that Flash Player 9 added support for caching the Flex Framework within the Flash Player itself.
The biggest thing about flex is the framework itself which loads on startup. Flex 3 will introduce framework caching. which will reduce the startup time dramatically. That means it loads the framwork on the first flex site you visit and it gets cached. The second flex site you visit whill only load its own assets. With this caching you can reduce your app to just a few kb.
Ajax has another issue, because assets (including scripts) are transferred as separate HTTP requests. Most browsers default to handling eight simultaneous requests, with only two from any given domain.
(SWF files contain multiple assets within a single HTTP connection, and can start to display before fully downloaded. Flex defaults to an upfront load, however.)
Bottom line: For comparable content, SWF can be more responsive.
The points above about modules and caching are spot-on. More background, and a link to Dirk Eismann’s recent work:
http://weblogs.macromedia.com/jd/archives/2007/09/fast_flex.cfm
jd/adobe