Runtime Styles - Bloated and Slow?
Posted by: shaun in Flex, Runtime Styles, OptimizationSo I really like the idea of runtime styles in Flex. Enough that I went through the process of moving my styles out of my app and into an external swf even though it wasn’t absolutely necessary. My thought was that this would gain me some flexibility in the future, and I could then share the style swf between apps if I ever needed to.
Then, in the process of optimization, I noticed that my Style SWF file was 127k in size. Ouch. Using an RSL got that down to about 50k. Better… but not good. So I decided to put the styles back into my app to see what the difference would be, if any. It turns out that adding it back only added 24k to main app!
Not only this, but initialization time was cut by 1/4th. On top of this, any dynamic updates I made to styles while running were noticably faster as well.
It was probably my imagination, but it seemed as though everything was faster, even just switching app locations, creating components, etc.
This was all done with Flex 2.0.1, and I am hoping that I do not experience the same symptoms when I move to Flex 3. For now, I am staying away from runtime styles unless they are absolutely required. I recommend you do the same if you don’t have an explicit need for them.
~Shaun


Entries (RSS)
July 6th, 2008 at 5:15 pm
Hey!, was searching Google for dynamic optimization and your blog regarding H coder » Runtime Styles - Bloated and Slow? looks really interesting for me. I will definitely bookmark it and come back for more cool postings to read! Cheers!