December 4, 2010

Spark vs. MX – size of Flex application

I’m building several applications based on newer Flex/Spark architecture. It is good practice to keep application at minimal size. With Spark architecture I hit several problems.

One critical problem is that application with Spark is quite big. I decided to enable support for RSL…

There is problem that RSL is available only for official releases of Flex SDK. You can run aplication on developer’s machine, but user will see some fancy errors.

There is another problem with Adobe’s RSL. Browser will contact Adobe server before application start. You could see 3-5 connections. Flash Player is checking version of RSL. This will slow down start of application. It could take 10 seconds in network with higher latency. That is very bad.

Therefore only viable solution is to turn off RSL and use “Merge into code”.

Folks who advocate for Spark says that it is much more efficient and it has better structure. Sure, it’s true. You can do many things with Spark much easier than with MX.

I was wondering why were my applications with Spark that big. I made small reasearch. You can see comparison between MX, Spark and MX+Spark projects on followich chart. In the first step I was testing only size of application with just one Button in Release mode. Then I’ve added some other components and application starts growing.

[kml_flashembed movie=”/wp-content/flex/flex-size/FlexSize.swf” height=”500″ width=”500″ fversion=”10.1″]

Measured against Flex SDK 4.5.0.17689.

The last result with Spark is very sad, because Spark application with Button, DataGrid, FormItem and TextInput is two times bigger than application using MX.

Do you know about any way how to shrink Spark applications?