[
https://issues.apache.org/jira/browse/FLEX-26719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Justin Mclean reassigned FLEX-26719:
------------------------------------
Assignee: (was: Justin Mclean)
> [flex_next] Much slower instantiation of visual components in SDK 4
> -------------------------------------------------------------------
>
> Key: FLEX-26719
> URL: https://issues.apache.org/jira/browse/FLEX-26719
> Project: Apache Flex
> Issue Type: Bug
> Components: .Unspecified - Framework
> Affects Versions: Adobe Flex SDK 4.1 (Release)
> Environment: Affected OS(s): All OS Platforms
> Affected OS(s): All OS Platforms
> Browser: Firefox 3.x
> Language Found: English
> Reporter: Adobe JIRA
> Priority: Critical
>
> Steps to reproduce:
> 1. Build a simple Flex MX application, which creates a large number of visual
> components (or use the sample).
> 2. Make sure to set Halo theme in SDK 4 application.
> 3. Compile and run it with SDK 3.5 and SDK 4, noticing time it takes from
> starting creating components till creation is complete.
> 4. Do the same as in 3. only this time set Spark theme in SDK 4 MX
> application.
> 5. Build equivalent pure-Spark SDK 4 application (or use the sample) and
> compare times.
>
> For more details see: http://forums.adobe.com/thread/786472?tstart=0
> Actual Results:
> Under SDK 4 with Halo Theme it takes 30-40% more time to create components
> (may vary across environments).
> On more complex real MX Halo application (up to 500 visual elements per
> complex component) the observed difference was up to x3-x4.
> Under SDK 4 with Spark Theme it takes 300-400% (!!!) more time to do the same.
> Pure Spark SDK 4 application with Spark Theme is as slow as SDK 4 MX one with
> Spark Theme.
> Expected Results:
> Time to instantiate visual components should be about the same under any SDK
> going up from version 3, otherwise upgrading existing applications becomes
> problematic due to worsening user experience.
> Same is expected from different Themes.
> Pure Spark application should be as fast if not faster than equivalent MX
> code.
> Workaround (if any):
>
> Redesign complex components to defer instantiation of widgets for as long as
> possible. Reduce number of containers. Move as much as possible code from
> MXML into AS, prefer AS-based skins over MXML.
> Sample MX application:
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
> minWidth="955" minHeight="600">
> <mx:Script>
> <![CDATA[
> import flash.utils.getTimer;
> import mx.containers.HBox;
> import mx.controls.CheckBox;
> import mx.events.FlexEvent;
>
> protected function button1_clickHandler(event:MouseEvent):void
> {
> holder.removeAllChildren();
> var start:int = getTimer();
> var holdAll:VBox = new VBox();
> holdAll.addEventListener(FlexEvent.CREATION_COMPLETE,
> function():void {
> var end:Number = getTimer();
> info.text = (end - start).toString();
> });
> for (var i:int = 0; i < 5; i++) {
> var vb:VBox = new VBox();
> var lbl:Label = new Label();
> lbl.text = "VBox " + i.toString();
> vb.addChild(lbl);
> for (var j:int = 0; j < 5; j++) {
> var c:HBox = new HBox();
> for (var k:int = 0; k < 10; k++) {
> var comp:CheckBox = new CheckBox();
> comp.label = k.toString();
> comp.width = 100;
> c.addChild(comp);
> }
>
> vb.addChild(c);
> }
> holdAll.addChild(vb);
> }
> holder.addChild(holdAll);
> }
> ]]
> >
> </mx:Script>
> <mx:Button label="Add Complex Component" width="300"
> click="button1_clickHandler(event)"/>
> <mx:Label id="info" text="Time will be here" />
> <mx:VBox id="holder">
> </mx:VBox>
> </mx:Application>
> Sample Spark application:
> <?xml version="1.0" encoding="utf-8"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
> xmlns:s="library://ns.adobe.com/flex/spark"
> xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955"
> minHeight="600">
> <s:layout>
> <s:VerticalLayout horizontalAlign="center" verticalAlign="top" />
> </s:layout>
> <fx:Declarations>
> <!-- Place non-visual elements (e.g., services, value objects) here
> -->
> </fx:Declarations>
> <fx:Script>
> <![CDATA[
> import flash.utils.getTimer;
>
> import mx.controls.DateField;
> import mx.events.FlexEvent;
>
> import spark.components.CheckBox;
> // import mx.controls.CheckBox;
> import spark.components.HGroup;
>
> protected function button1_clickHandler(event:MouseEvent):void
> {
> holder.removeAllElements();
> var start:int = getTimer();
> var holdAll:VGroup = new VGroup();
> holdAll.addEventListener(FlexEvent.CREATION_COMPLETE,
> function():void {
> var end:Number = getTimer();
> info.text = (end - start).toString();
> });
> for (var i:int = 0; i < 5; i++) {
> var vb:VGroup = new VGroup();
> var lbl:Label = new Label();
> lbl.text = "VBox " + i.toString();
> vb.addElement(lbl);
> for (var j:int = 0; j < 5; j++) {
> var c:HGroup = new HGroup();
> for (var k:int = 0; k < 10; k++) {
> var comp:CheckBox = new CheckBox();
> comp.label = k.toString();
> comp.width = 100;
> c.addElement(comp);
> }
>
> vb.addElement(c);
> }
> holdAll.addElement(vb);
> }
> holder.addElement(holdAll);
> }
>
> ]]
> >
> </fx:Script>
> <s:Button label="Add Complex Component" width="300"
> click="button1_clickHandler(event)"/>
> <s:Label id="info" text="Time will be here" />
> <s:VGroup id="holder">
> </s:VGroup>
> </s:Application>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira