Jfreechart 0.6.0 vs Jfreechart 0.9.2 Performance

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Achilleus Mantzios

Jfreechart 0.6.0 vs Jfreechart 0.9.2 Performance

Post by Achilleus Mantzios » Wed Aug 28, 2002 10:46 am

Hi,

I just ported one simple servlet producing an image out of a TimeSeries Chart
to JFreechart 0.9.2.
The chart's plot uses a custom XYItemRenderer (which is the same
as in 0.6.0, altho i had to change the plot parameter in drawItem method
from Plot to XYPlot, inorder not to use the superclass's drawItem method).

Unfortunately i noticed a 11% performance degradation using 0.9.2
compared to 0.6.0.

I have not done any profiling.
Does anybody have an idea of this issue???
(maybe i am doing something wrong that hurts the speed, but basically
i did nothing but trivially porting the ItemRenderer and my servlet)

Thanx.

David Gilbert

Re: Jfreechart 0.6.0 vs Jfreechart 0.9.2 Performance

Post by David Gilbert » Wed Aug 28, 2002 10:54 am

Hi Achilleus,

It could be the collection of tooltip information, or mouse events, or just the reorganisation of the code. 11% doesn't surprise me too much.

One thing I definitely plan to do before JFreeChart reaches 1.0.0 is to put together some benchmarking code and work out exactly where the bottlenecks are. So far I haven't been that concerned about performance, just getting the features right and making sure the API is consistent. And although performance will never be the number 1 goal, I do want to make sure the code isn't doing anything silly.

So if you have any suggestions, they're welcome...

Regards,

DG.

Achilleus Mantzios

Re: Jfreechart 0.6.0 vs Jfreechart 0.9.2 Performance

Post by Achilleus Mantzios » Wed Aug 28, 2002 11:29 am

Well several features (mouse clicks, registration of event listeners, zooming, etc...)
make sense only in an interactive standalone or applet run.
When used in server side code, i think there should be a simplified version
of jfreechart,various plots,item renderers, that would fit in this environment
more appropriately.

Thats all i can say for now :)

Achilleus Mantzios

Re: Jfreechart 0.6.0 vs Jfreechart 0.9.2 Performance

Post by Achilleus Mantzios » Wed Aug 28, 2002 12:05 pm

David, can you think of a speed up solution for 0.9.2,
leaving the JfreeChart libraries untouched??

Achilleus Mantzios

Re: Jfreechart 0.6.0 vs Jfreechart 0.9.2 Performance

Post by Achilleus Mantzios » Wed Aug 28, 2002 3:51 pm

By not calling super() in my XYItemRenderer constructor
(getting rid of tooltips, listeners, etc..)
performance is great.
(even faster than 0.6.0).

David, also i noticed a wierd "scaling" effect on HighLow charts.
I mean my previous (0.6.0) and present (0.9.2) image output is not the same.
Do you have anything in mind??

Thanx.

David Gilbert

Re: Jfreechart 0.6.0 vs Jfreechart 0.9.2 Performance

Post by David Gilbert » Fri Aug 30, 2002 7:36 am

The scaling you mention is only implemented in the ChartPanel class, which I wouldn't expect anyone to use in a servlet environment.

The idea of the scaling is that you specify the maximum size at which the chart will be drawn and, if the panel is larger than this, a transform is used to scale the chart size up to fit the available space. Some people like this, others hate it...but you can easily change the threshold at which the scaling is used (using the setMaximumDrawHeight and setMaximumDrawWidth methods in the ChartPanel class.

Regards,

DG.

Achilleus Mantzios

Re: Jfreechart 0.6.0 vs Jfreechart 0.9.2 Performance

Post by Achilleus Mantzios » Fri Aug 30, 2002 10:48 am

Thanx, it was my fault anyway.
Well, i keep on porting and debugging :)

Locked