BAD Performance -> PNG Encoder

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Sourcemaker
Posts: 15
Joined: Thu Jun 24, 2004 3:01 pm

BAD Performance -> PNG Encoder

Post by Sourcemaker » Mon Jul 05, 2004 5:02 pm

Well, is there any open-source replacement of the PNGEncoder
from keypoint ? I think this encoder works very slow.

angel
Posts: 899
Joined: Thu Jan 15, 2004 12:07 am
Location: Germany - Palatinate

Post by angel » Tue Jul 06, 2004 7:09 am

I can't tell that the actual PNGEncoder is slow, but if you find one which handles higher resolutions then please let us know

Guest

Post by Guest » Tue Jul 06, 2004 11:15 am

Well I think it works fine. I have implemented the trove java performance
classes and a lru caching. Now generating charts
as image takes about 1 second. (XML Parsing inclusive) :-)[/b]

richard_atkinson
Posts: 115
Joined: Fri Mar 14, 2003 3:13 pm
Location: London, England
Contact:

Re: BAD Performance -> PNG Encoder

Post by richard_atkinson » Tue Jul 06, 2004 1:19 pm

Sourcemaker wrote:I think this encoder works very slow.
You really need to justify statements like that. How slow? What size of chart? etc. I've done some benchmarking with a 500x300 stacked area chart with 3 series and 15 points per series producing a PNG file of around 15KB. On a 1.6GHz P4 the time to encode the PNG file is consistently around 0.2 seconds. Replacing the Keypoint encoder with the Sun PNG encoder in JDK 1.4+ reduces the encoding time by between 5 and 10% on average. But when the original encoding time is 0.2 seconds, it really is not that significant.

Total chart creation time including writing the image to disk is average just over 0.4 seconds. The majority of the time is spent creating the BufferedImage (~0.2 seconds) and encoding the PNG file (~0.2 seconds). The time spent creating the dataset, creating the JFreeChart object and writing the image to disk were all neglible.

Regards,
Richard...

arnaud
Posts: 86
Joined: Wed Mar 19, 2003 2:59 pm
Location: Paris, France
Contact:

Post by arnaud » Mon Jul 19, 2004 10:31 am

Hello,

I had some issues concerning chart printing, and worked some time ago on a solution to improve chart resolution (cf topic). The trouble was that, of course , it tooks more time to render an image with the same size but 300 dpi instead of screen resolution. However, as my application was not displaying many charts at the same time, usability was OK.

I recently changed from Swing to HTML, and building a multi-page report in a single jsp file. I used the High Resolution rendering features mentioned above and rendering of my report tooks more than 4 minutes.... I made some output debugging to understand the most time consuming function, and it was the PNG Encoding function, taking more than 70-80% of the time. I then decided to have a go whith the SUN Java Advanced Imaging API encoders and found that things were going faster by a factor 4 or 5 !!

I still need some reworking to make things clean ; if I'll have some more time, I'll give You some facts...

Regards,
Arnaud

Locked