Styles, Fonts, and Compile Time
There has been some recent conversation about the impact of styles and fonts on compilation time in Flex Builder 3. I figured I'd take the project I'm currently working on and see what the numbers came out as.
Some more details about the test: About 700KB of raw .as and .mxml code. 2 separate CSS files are imported. 120KB of TTF fonts. 650KB of SWF fonts. Compiling using Flex 2.0.1 Hotfix 3 SDK. Each tests was run 3 times with the average time reported. Each test was run by changing text in the top level MXML component, saving it, and timing a manual build. Timing was from time of click until the progress view reported the build was finished. Copy non-embedded and generate HTML template were disabled.
As with all measurements these should be taken with a grain of salt and are meant to be representative. Your project will vary, yadda, yadda, yadda.
Compile State | Compile Time (in seconds) |
---|---|
All styles, 11 SWF fonts, and 2 TTF fonts | 11.3 |
No styles or fonts | 4.8 |
All styles and no fonts | 6.9 |
All styles and 8 SWF fonts | 9.1 |
All styles and 2 TTF fonts | 9.1 |
All styles and 3 SWF fonts | 8.1 |
Clearly using TTF encoded fonts has a higher overhead than SWF encoded fonts. More fonts take more time. The next item to explore is using Flex Builder 3's compile CSS to SWF option. Doing that would require looking at application startup time since the styles would no longer be compiled in but instead loaded during startup.
Comments
Posted by: Brian Deitte | November 6, 2007 1:13 PM