incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maurice Amsellem (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (FLEX-33216) Chart initialization performance degradation between Flex 3 and Flex 4
Date Mon, 15 Oct 2012 08:48:03 GMT

    [ https://issues.apache.org/jira/browse/FLEX-33216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13476032#comment-13476032
] 

Maurice Amsellem edited comment on FLEX-33216 at 10/15/12 8:46 AM:
-------------------------------------------------------------------

One reason of this performance degradation is that Flex4 Chart style initialization is called
for every instance, whereas it should be called only once.

Example for CartesianChart:

	override public function set moduleFactory(factory:IFlexModuleFactory):void
	{
		super.moduleFactory = factory;		
		if (_moduleFactoryInitialized)
			return;		
		_moduleFactoryInitialized = true;				
		initStyles();
		styleManager.registerInheritingStyle("axisTitleStyleName");
	}

	private function initStyles():Boolean
	{
		HaloDefaults.init(styleManager);
		
		var cartesianChartStyle:CSSStyleDeclaration =
			HaloDefaults.createSelector("mx.charts.chartClasses.CartesianChart", styleManager);
		
		cartesianChartStyle.defaultFactory = function():void
		{
			this.axisColor = 0xD5DEDD;
			this.chartSeriesStyles = HaloDefaults.chartBaseChartSeriesStyles;
			this.dataTipRenderer = DataTip;
			this.fill = new SolidColor(0xFFFFFF, 0);
			this.calloutStroke = new Stroke(0x888888,2);            
			this.fontSize = 10;
			this.horizontalAxisStyleName = "blockCategoryAxis";
			this.secondHorizontalAxisStyleName = "blockCategoryAxis";
			this.secondVerticalAxisStyleName = "blockNumericAxis";
			this.verticalAxisStyleName = "blockNumericAxis";
			this.horizontalAxisStyleNames = ["blockCategoryAxis"];
			this.verticalAxisStyleNames = ["blockNumericAxis"];
		}
		
		return true;
	}



                
      was (Author: mamsellem):
    One reason of this performance degradation is that Flex4 Chart style initialization is
called for every instance, whereas it should be called only once.

Example for CartesianChart
{code}
	override public function set moduleFactory(factory:IFlexModuleFactory):void
	{
		super.moduleFactory = factory;		
		if (_moduleFactoryInitialized)
			return;		
		_moduleFactoryInitialized = true;				
		initStyles();
		styleManager.registerInheritingStyle("axisTitleStyleName");
	}

	private function initStyles():Boolean
	{
		HaloDefaults.init(styleManager);
		
		var cartesianChartStyle:CSSStyleDeclaration =
			HaloDefaults.createSelector("mx.charts.chartClasses.CartesianChart", styleManager);
		
		cartesianChartStyle.defaultFactory = function():void
		{
			this.axisColor = 0xD5DEDD;
			this.chartSeriesStyles = HaloDefaults.chartBaseChartSeriesStyles;
			this.dataTipRenderer = DataTip;
			this.fill = new SolidColor(0xFFFFFF, 0);
			this.calloutStroke = new Stroke(0x888888,2);            
			this.fontSize = 10;
			this.horizontalAxisStyleName = "blockCategoryAxis";
			this.secondHorizontalAxisStyleName = "blockCategoryAxis";
			this.secondVerticalAxisStyleName = "blockNumericAxis";
			this.verticalAxisStyleName = "blockNumericAxis";
			this.horizontalAxisStyleNames = ["blockCategoryAxis"];
			this.verticalAxisStyleNames = ["blockNumericAxis"];
		}
		
		return true;
	}

{code}


                  
> Chart initialization performance degradation between Flex 3 and Flex 4
> ----------------------------------------------------------------------
>
>                 Key: FLEX-33216
>                 URL: https://issues.apache.org/jira/browse/FLEX-33216
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Charts
>    Affects Versions: Adobe Flex SDK 4.1 (Release), Adobe Flex SDK 4.5 (Release), Adobe
Flex SDK 4.6 (Release)
>            Reporter: Maurice Amsellem
>              Labels: performance
>
> Chart initialization is around 35-40% slower in Flex4 than in Flex3.
> This is true for almost all chart types (Bar, Pie, Column, etc.)

--
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

Mime
View raw message