Slow performance with large TimeSeries Dataset

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
SystemsEngineer
Posts: 16
Joined: Thu Jan 19, 2017 5:54 pm
antibot: No, of course not.

Slow performance with large TimeSeries Dataset

Post by SystemsEngineer » Thu Mar 30, 2017 11:41 am

Hello,

I'm trying to plot a relatively large TimeSeries data set (about 2000 data points) and it takes almost 1 minute to plot! I changed the renderer from XYLineAndShapeRenderer to SamplingXYLineRenderer but it made no difference. I also tried to add data and create the data set before I create the plot but without any improvement.

Any ideas on how to work around this issue would be very much appreciated.

Thanks a lot!

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Slow performance with large TimeSeries Dataset

Post by david.gilbert » Fri Mar 31, 2017 7:02 pm

You should post some sample code, because almost certainly something else is happening...2000 data points won't take a fraction of a second.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

SystemsEngineer
Posts: 16
Joined: Thu Jan 19, 2017 5:54 pm
antibot: No, of course not.

Re: Slow performance with large TimeSeries Dataset

Post by SystemsEngineer » Mon Apr 03, 2017 2:48 pm

Thanks for your reply.

You were right, I was retrieving the data from a database which created the additional delay. Now this is fixed and plots up to 5E4 data points are generated fast, I've noticed however that beyond that the delay (around 10 sec) is inevitable, which I suppose is expected (?).

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Slow performance with large TimeSeries Dataset

Post by paradoxoff » Mon Apr 03, 2017 4:22 pm

That depends on how exactly you use your TimeSeries. If you first create your chart with an empty dataset, and then, while the chart is already visible, add new items to your TimeSeries without disabling the event notification, you will force one redraw for each item. Under these conditions, 10 sec for 50k data points looks reasonable. The actual speed is also dependent on the renderer.
If speed is a major concern, I would not use a TimeSeries, but e. g. a DefaultXYDataset. This dataset can also be used to construct a time series chart, though it may be a bit less intuitive.

SystemsEngineer
Posts: 16
Joined: Thu Jan 19, 2017 5:54 pm
antibot: No, of course not.

Re: Slow performance with large TimeSeries Dataset

Post by SystemsEngineer » Mon Apr 03, 2017 6:30 pm

As you said, first I create the dataset and then I create the chart and add the dataset to it. The renderer is a simple XYLineAndShapeRenderer. However, I will consider your suggestion about the DefaultXYDataset.
Thanks a lot!

Locked