Home » Archived » BIRT » BIRT Chart Performance Issues
BIRT Chart Performance Issues [message #548945] |
Fri, 23 July 2010 10:00  |
Eclipse User |
|
|
|
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 11:41   |
Eclipse User |
|
|
|
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 #549422 is a reply to message #549239] |
Mon, 26 July 2010 11:04  |
Eclipse User |
|
|
|
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.
|
|
|
Goto Forum:
Current Time: Tue Jul 22 18:03:41 EDT 2025
Powered by FUDForum. Page generated in 0.07358 seconds
|