Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » BIRT Chart Performance Issues
icon5.gif  BIRT Chart Performance Issues [message #548945] Fri, 23 July 2010 14:00 Go to next message
Adrian Issott is currently offline Adrian IssottFriend
Messages: 3
Registered: July 2010
Junior Member
Hi,

I've just been evaluating whether my team can make use of the BIRT charting libraries and whilst the functionality provided by org.eclipse.birt.chart looks good, my tests show the performance isn't close to being good enough for us. Here are my initial results:

* Eclipse Helios
* BIRT v2.6
* Based on the SwtChartViewerSelector.java in org.eclipse.birt.chart.examples.core_2.6.0.v20100607.jar
* Stacked area graph
* 1 x-axis series of 300 doubles (0 -> 30, incrementing by 0.1 each time)
* 10 y-axis series of 300 doubles (randomly generated between 0 and 100)


Time taken to paint the chart the first time: 2100ms
Time taken to repaint the chart: 1600ms


We're looking for something in the region of 100ms.

So, my questions are:
1, Do these figures look right? Hopefully I've configured the chart badly somehow ...
2, If these figures do look right is there any work on-going to fix the problem?

We'd really like to make use of BIRT if we could fix this issue ...

Many thanks in advance,
Adrian

PS 100ms is completely doable as shown by similar tests using www.swtchart.org. Unfortunately that's much less actively maintained and doesn't have all the functionality we need.

------------------------------------------------------------ ---------------------------

PPS Since I can't seem to attach files in this forum, here are the relevant code snippets (everything else in org.eclipse.birt.chart.examples.core is unchanged):

Added to src/org/eclipse/birt/chart/examples/api/viewer/PrimitiveChar ts.java:
	private static final int NUM_TIME_INTERVALS = 300;

	private static final SeriesDefinition xSeriesDefinition = xSeriesDefinition();
	private static final SeriesDefinition xSeriesDefinition() {
		// Data Set
		double[] timeArray = new double[NUM_TIME_INTERVALS];
		double time = 0;
		for (int timeIndex = 0; timeIndex < NUM_TIME_INTERVALS; timeIndex++) {
			timeArray[timeIndex] = time;
			time += 0.1;
		}
		NumberDataSet timeValues = NumberDataSetImpl.create(timeArray);
	
		// Series
		Series timeIntervalSeries = SeriesImpl.create( );
		timeIntervalSeries.setDataSet( timeValues );		
		
		SeriesDefinition sdX = SeriesDefinitionImpl.create( );
		sdX.getSeriesPalette( ).shift( 0 );
		sdX.getSeries( ).add( timeIntervalSeries );
		
		return sdX;
	}
	
	private static final int NUM_THREADS = 10;

	private static final SeriesDefinition ySeriesDefinition = ySeriesDefinition();
	private static final SeriesDefinition ySeriesDefinition() {		
		SeriesDefinition sdY = SeriesDefinitionImpl.create( );
		sdY.getSeriesPalette( ).shift( -1 );
		
		for (int threadIndex = 1; threadIndex <= NUM_THREADS; threadIndex++) {
			double[] threadArray = new double[NUM_TIME_INTERVALS];
			for (int timeIndex = 0; timeIndex < NUM_TIME_INTERVALS; timeIndex++) {
				threadArray[timeIndex] = Math.random() * 100;
			}
			NumberDataSet orthoValues = NumberDataSetImpl.create(threadArray);

			AreaSeries as = (AreaSeries) AreaSeriesImpl.create( );
			as.setSeriesIdentifier( "Thread "+threadIndex );//$NON-NLS-1$
			as.setDataSet( orthoValues );		
			
			sdY.getSeries( ).add( as );
		}

		return sdY;
	}


Replacing the previous implementation of this function in src/org/eclipse/birt/chart/examples/api/viewer/PrimitiveChar ts.java:
	
public static final Chart createAreaChart( )
	{
		ChartWithAxes cwaArea = ChartWithAxesImpl.create( );

		// Plot/Title
		cwaArea.getBlock( ).setBackground( ColorDefinitionImpl.WHITE( ) );
		Plot p = cwaArea.getPlot( );
		p.getClientArea( ).setBackground( ColorDefinitionImpl.create( 225,
				225,
				225 ) );
		cwaArea.getTitle( ).getLabel( ).getCaption( ).setValue( "Area Chart" );//$NON-NLS-1$
		cwaArea.getTitle( ).setVisible( true );

		// X-Axis
		Axis xAxisPrimary = cwaArea.getPrimaryBaseAxes( )[0];
		xAxisPrimary.setType( AxisType.LINEAR_LITERAL );
		xAxisPrimary.getOrigin( ).setType( IntersectionType.MIN_LITERAL );
		xAxisPrimary.getTitle( ).getCaption( ).setValue( "Time / s" );//$NON-NLS-1$
		xAxisPrimary.getTitle( ).setVisible( true );
		xAxisPrimary.getTitle( ).getCaption( ).getFont( ).setRotation( 0 );
		xAxisPrimary.getLabel( ).setVisible( true );

		// Y-Axis
		Axis yAxisPrimary = cwaArea.getPrimaryOrthogonalAxis( xAxisPrimary );
		yAxisPrimary.setPercent( false );
		yAxisPrimary.setType( AxisType.LINEAR_LITERAL );
		yAxisPrimary.getTitle( ).getCaption( ).setValue( "% CPU Usage" );//$NON-NLS-1$
		yAxisPrimary.getTitle( ).setVisible( true );
		yAxisPrimary.getTitle( ).getCaption( ).getFont( ).setRotation( 90 );
		yAxisPrimary.getLabel( ).setVisible( true );

		xAxisPrimary.getSeriesDefinitions( ).add( xSeriesDefinition );
		yAxisPrimary.getSeriesDefinitions( ).add( ySeriesDefinition );
		
		return cwaArea;
	}


Updated in /src/org/eclipse/birt/chart/examples/api/viewer/SwtChartView erSelector.java:
	
public final void paintControl( PaintEvent e )
	{
>		long startTime = System.currentTimeMillis();
		
		Rectangle d = this.getClientArea( );
		Image imgChart = new Image( this.getDisplay( ), d );
		GC gcImage = new GC( imgChart );
		idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, gcImage );
		idr.setProperty( IDeviceRenderer.UPDATE_NOTIFIER, this );

		Bounds bo = BoundsImpl.create( 0, 0, d.width, d.height );
		bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );

		Generator gr = Generator.instance( );
		if ( bNeedsGeneration )
		{
			bNeedsGeneration = false;
			try
			{
				gcs = gr.build( idr.getDisplayServer( ),
						cm,
						bo,
						null,
						null,
						null );
			}
			catch ( ChartException ce )
			{
				ce.printStackTrace( );
			}
		}

		try
		{
			gr.render( idr, gcs );
			GC gc = e.gc;
			gc.drawImage( imgChart, d.x, d.y );
		}
		catch ( ChartException gex )
		{
			showException( e.gc, gex );
		}
		
>		long stopTime = System.currentTimeMillis();
>		System.out.printf("Painting the control took: %dms\n", stopTime - startTime);
	}
Re: BIRT Chart Performance Issues [message #549002 is a reply to message #548945] Fri, 23 July 2010 15:41 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Adrian,

I tried this with the 2.6 source, making the changes you suggested and
got much lower times. First time 550 ms and after that 350 ms, many of
the other charts where 50-60 ms.

Jason

On 7/23/2010 10:00 AM, Adrian Issott wrote:
> Hi,
>
> I've just been evaluating whether my team can make use of the BIRT
> charting libraries and whilst the functionality provided by
> org.eclipse.birt.chart looks good, my tests show the performance isn't
> close to being good enough for us. Here are my initial results:
>
> * Eclipse Helios
> * BIRT v2.6
> * Based on the SwtChartViewerSelector.java in
> org.eclipse.birt.chart.examples.core_2.6.0.v20100607.jar
> * Stacked area graph
> * 1 x-axis series of 300 doubles (0 -> 30, incrementing by 0.1 each time)
> * 10 y-axis series of 300 doubles (randomly generated between 0 and 100)
>
>
> Time taken to paint the chart the first time: 2100ms
> Time taken to repaint the chart: 1600ms
>
>
> We're looking for something in the region of 100ms.
> So, my questions are:
> 1, Do these figures look right? Hopefully I've configured the chart
> badly somehow ...
> 2, If these figures do look right is there any work on-going to fix the
> problem?
>
> We'd really like to make use of BIRT if we could fix this issue ...
>
> Many thanks in advance,
> Adrian
>
> PS 100ms is completely doable as shown by similar tests using
> www.swtchart.org. Unfortunately that's much less actively maintained and
> doesn't have all the functionality we need.
>
> ------------------------------------------------------------
> ---------------------------
>
> PPS Since I can't seem to attach files in this forum, here are the
> relevant code snippets (everything else in
> org.eclipse.birt.chart.examples.core is unchanged):
>
> Added to src/org/eclipse/birt/chart/examples/api/viewer/PrimitiveChar
> ts.java:
>
> private static final int NUM_TIME_INTERVALS = 300;
>
> private static final SeriesDefinition xSeriesDefinition =
> xSeriesDefinition();
> private static final SeriesDefinition xSeriesDefinition() {
> // Data Set
> double[] timeArray = new double[NUM_TIME_INTERVALS];
> double time = 0;
> for (int timeIndex = 0; timeIndex < NUM_TIME_INTERVALS; timeIndex++) {
> timeArray[timeIndex] = time;
> time += 0.1;
> }
> NumberDataSet timeValues = NumberDataSetImpl.create(timeArray);
>
> // Series
> Series timeIntervalSeries = SeriesImpl.create( );
> timeIntervalSeries.setDataSet( timeValues );
>
> SeriesDefinition sdX = SeriesDefinitionImpl.create( );
> sdX.getSeriesPalette( ).shift( 0 );
> sdX.getSeries( ).add( timeIntervalSeries );
>
> return sdX;
> }
>
> private static final int NUM_THREADS = 10;
>
> private static final SeriesDefinition ySeriesDefinition =
> ySeriesDefinition();
> private static final SeriesDefinition ySeriesDefinition() {
> SeriesDefinition sdY = SeriesDefinitionImpl.create( );
> sdY.getSeriesPalette( ).shift( -1 );
>
> for (int threadIndex = 1; threadIndex <= NUM_THREADS; threadIndex++) {
> double[] threadArray = new double[NUM_TIME_INTERVALS];
> for (int timeIndex = 0; timeIndex < NUM_TIME_INTERVALS; timeIndex++) {
> threadArray[timeIndex] = Math.random() * 100;
> }
> NumberDataSet orthoValues = NumberDataSetImpl.create(threadArray);
>
> AreaSeries as = (AreaSeries) AreaSeriesImpl.create( );
> as.setSeriesIdentifier( "Thread "+threadIndex );//$NON-NLS-1$
> as.setDataSet( orthoValues );
>
> sdY.getSeries( ).add( as );
> }
>
> return sdY;
> }
>
>
> Replacing the previous implementation of this function in
> src/org/eclipse/birt/chart/examples/api/viewer/PrimitiveChar ts.java:
>
> public static final Chart createAreaChart( )
> {
> ChartWithAxes cwaArea = ChartWithAxesImpl.create( );
>
> // Plot/Title
> cwaArea.getBlock( ).setBackground( ColorDefinitionImpl.WHITE( ) );
> Plot p = cwaArea.getPlot( );
> p.getClientArea( ).setBackground( ColorDefinitionImpl.create( 225,
> 225,
> 225 ) );
> cwaArea.getTitle( ).getLabel( ).getCaption( ).setValue( "Area Chart"
> );//$NON-NLS-1$
> cwaArea.getTitle( ).setVisible( true );
>
> // X-Axis
> Axis xAxisPrimary = cwaArea.getPrimaryBaseAxes( )[0];
> xAxisPrimary.setType( AxisType.LINEAR_LITERAL );
> xAxisPrimary.getOrigin( ).setType( IntersectionType.MIN_LITERAL );
> xAxisPrimary.getTitle( ).getCaption( ).setValue( "Time / s" );//$NON-NLS-1$
> xAxisPrimary.getTitle( ).setVisible( true );
> xAxisPrimary.getTitle( ).getCaption( ).getFont( ).setRotation( 0 );
> xAxisPrimary.getLabel( ).setVisible( true );
>
> // Y-Axis
> Axis yAxisPrimary = cwaArea.getPrimaryOrthogonalAxis( xAxisPrimary );
> yAxisPrimary.setPercent( false );
> yAxisPrimary.setType( AxisType.LINEAR_LITERAL );
> yAxisPrimary.getTitle( ).getCaption( ).setValue( "% CPU Usage"
> );//$NON-NLS-1$
> yAxisPrimary.getTitle( ).setVisible( true );
> yAxisPrimary.getTitle( ).getCaption( ).getFont( ).setRotation( 90 );
> yAxisPrimary.getLabel( ).setVisible( true );
>
> xAxisPrimary.getSeriesDefinitions( ).add( xSeriesDefinition );
> yAxisPrimary.getSeriesDefinitions( ).add( ySeriesDefinition );
>
> return cwaArea;
> }
>
>
> Updated in /src/org/eclipse/birt/chart/examples/api/viewer/SwtChartView
> erSelector.java:
>
> public final void paintControl( PaintEvent e )
> {
>> long startTime = System.currentTimeMillis();
>
> Rectangle d = this.getClientArea( );
> Image imgChart = new Image( this.getDisplay( ), d );
> GC gcImage = new GC( imgChart );
> idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, gcImage );
> idr.setProperty( IDeviceRenderer.UPDATE_NOTIFIER, this );
>
> Bounds bo = BoundsImpl.create( 0, 0, d.width, d.height );
> bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );
>
> Generator gr = Generator.instance( );
> if ( bNeedsGeneration )
> {
> bNeedsGeneration = false;
> try
> {
> gcs = gr.build( idr.getDisplayServer( ),
> cm,
> bo,
> null,
> null,
> null );
> }
> catch ( ChartException ce )
> {
> ce.printStackTrace( );
> }
> }
>
> try
> {
> gr.render( idr, gcs );
> GC gc = e.gc;
> gc.drawImage( imgChart, d.x, d.y );
> }
> catch ( ChartException gex )
> {
> showException( e.gc, gex );
> }
>
>> long stopTime = System.currentTimeMillis();
>> System.out.printf("Painting the control took: %dms\n", stopTime -
>> startTime);
> }
>
Re: BIRT Chart Performance Issues [message #549009 is a reply to message #549002] Fri, 23 July 2010 16:29 Go to previous messageGo to next message
Adrian Issott is currently offline Adrian IssottFriend
Messages: 3
Registered: July 2010
Junior Member
Quote:
I tried this with the 2.6 source, making the changes you suggested and got much lower times. First time 550 ms and after that 350 ms, many of the other charts where 50-60 ms.

That's quite a bit faster. What machine / OS did you run it on?

Here's my setup:
* Windows XP SP3
* Intel Core2 Duo T9600 @2.8GHz, 1.59GHz
* 3GB RAM

I just tried running it again with virtually every other application closed in case there was an issue with there not being enough free RAM (I was running Outlook : ) but I get the same results.

Quote:
many of the other charts where 50-60 ms

That'll be because those charts aren't trying to display much data - 10s of points rather than 1000s.

Cheers,
Adrian
Re: BIRT Chart Performance Issues [message #549024 is a reply to message #549009] Fri, 23 July 2010 17:17 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Adrian,

You are correct about the number of points. I am running this with
a lenova T410 i5 6 gigs of ram. I ran it in debug with two other
instances of Eclipse running. I use Win 7. Any chance you could open a
bugzilla for this as we like to get performance issues tracked. Can you
also post your code to it?

Jason

On 7/23/2010 12:29 PM, Adrian Issott wrote:
> Quote:
>> I tried this with the 2.6 source, making the changes you suggested and
>> got much lower times. First time 550 ms and after that 350 ms, many of
>> the other charts where 50-60 ms.
>
> That's quite a bit faster. What machine / OS did you run it on?
>
> Here's my setup:
> * Windows XP SP3
> * Intel Core2 Duo T9600 @2.8GHz, 1.59GHz
> * 3GB RAM
>
> I just tried running it again with virtually every other application
> closed in case there was an issue with there not being enough free RAM
> (I was running Outlook : ) but I get the same results.
>
> Quote:
>> many of the other charts where 50-60 ms
>
> That'll be because those charts aren't trying to display much data - 10s
> of points rather than 1000s.
>
> Cheers,
> Adrian
Re: BIRT Chart Performance Issues [message #549239 is a reply to message #549024] Mon, 26 July 2010 08:47 Go to previous messageGo to next message
Adrian Issott is currently offline Adrian IssottFriend
Messages: 3
Registered: July 2010
Junior Member
Just raised: Bug 320873 - Chart Building / Rendering Performance Issues (inc. the code I used).

Quote:
I am running this with a lenova T410 i5 6 gigs of ram.
I use Win 7.


Certainly sounds like you have a quicker system than mine. I'm a little surprised it makes as much of a factor of 4 improvement but I guess it's feasible. Anyhow, your results would still be too slow for us to use BIRT as it stands at the moment which is why I marked the above issue as a Major bug.
Re: BIRT Chart Performance Issues [message #549422 is a reply to message #549239] Mon, 26 July 2010 15:04 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Thanks

On 7/26/2010 4:47 AM, Adrian Issott wrote:
> Just raised: https://bugs.eclipse.org/bugs/show_bug.cgi?id=320873 (inc.
> the code I used).
>
> Quote:
>> I am running this with a lenova T410 i5 6 gigs of ram.
>> I use Win 7.
>
> Certainly sounds like you have a quicker system than mine. I'm a little
> surprised it makes as much of a factor of 4 improvement but I guess it's
> feasible. Anyhow, your results would still be too slow for us to use
> BIRT as it stands at the moment which is why I marked the above issue as
> a Major bug.
Previous Topic:Birt plugin to run only inside eclipse?
Next Topic:Iterating over datasets, API documentation and cross tab sub reports
Goto Forum:
  


Current Time: Thu Apr 25 10:10:06 GMT 2024

Powered by FUDForum. Page generated in 0.04024 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top