From reading previous posts I feel I should be able to answer this, but I need a categorical answer before we can spend more time evaluating JFreeChart. I am really hoping for positive answers, as all other features of the product look perfect for our purposes.
We have a proprietary J2EE application generator and content management tool that generates HTML from screen definitions stored in SQL. We wish to extend this to include charts.
Charts will be rendered on the server from SQL data and saved on the server as an image file with a known unique name, then the url for the image will be included in the generated HTML. Many pages will have multiple combination (bar and line) charts on the one page, and traffic will be high.
Two questions:
1) I understand the current version of JFreeChart is not thread safe and has problems with this scenario, but will the next version of (0.9.5) be suitable for this task? I.e., multiple simultaneous threads not interfering with each other?
2) I notice several posts re performance. I know this is an impossible "piece of string" question to ask, but would you expect 100ms or less response time on a "typical" server (say P4 2G Intel box running Linux) generating two combo charts, each with two x 12 bar series and two x 12-point line series? Just trying to get a rough feel for performance.
Regards
Rob
Servlets, Thread Syncronisation and Performance
Re: Servlets, Thread Syncronisation and Performance
Rob,
I'm not going to give you a categorical answer but can share my experience with you. I have been using JFreeChart for almost a year now to generate charts dynamically from SQL data for delivery in web applications.
From my perspective thread synchronization issues seem to be a lot more of an issue in client side environment with graphs changing dynamically in response to user interaction. Hence there are problems with the underlying datasets changing while the charts are being rendered. In a server-side environment this tends to be a lot less of an issue as (my) scenarios are all request/response based so the data is retrieved and the chart generated as a part of one request. Chart objects are not shared across users or requests.
You seem to want to do something slightly different with the generation of static charts and HTML and then delivering them over HTTP. However I still don't think thread synchronization is going to be an issue for you, as you will not be dealing with data modification during chart generation.
As for performance, the charts I tend to generate are reasonably complex for a low number of sophisticated users. The amount of time taken to generate the charts is dwarfed by the amount of time taken to get the data from the database. Consequently I've never bothered doing exact timing of the chart generation. Selectively caching the data has proved to be more effective at improving performance.
You would have to try it in your environment and see.
Regards,
Richard...
I'm not going to give you a categorical answer but can share my experience with you. I have been using JFreeChart for almost a year now to generate charts dynamically from SQL data for delivery in web applications.
From my perspective thread synchronization issues seem to be a lot more of an issue in client side environment with graphs changing dynamically in response to user interaction. Hence there are problems with the underlying datasets changing while the charts are being rendered. In a server-side environment this tends to be a lot less of an issue as (my) scenarios are all request/response based so the data is retrieved and the chart generated as a part of one request. Chart objects are not shared across users or requests.
You seem to want to do something slightly different with the generation of static charts and HTML and then delivering them over HTTP. However I still don't think thread synchronization is going to be an issue for you, as you will not be dealing with data modification during chart generation.
As for performance, the charts I tend to generate are reasonably complex for a low number of sophisticated users. The amount of time taken to generate the charts is dwarfed by the amount of time taken to get the data from the database. Consequently I've never bothered doing exact timing of the chart generation. Selectively caching the data has proved to be more effective at improving performance.
You would have to try it in your environment and see.
Regards,
Richard...
Re: Servlets, Thread Syncronisation and Performance
Rob,
I think I am doing a similar task to what you are trying to achieve. I have a servlet which pulls data from an Oracle database and generates a Time Series chart based on the time interval specified by the user. With each servlet request, an image is drawn with a specified name and saved to the /html folder on the weblogic server. The servlet then returns HTML with a simple image tag pointing to the image.
I have never had synchroniztion issues at all, this will all be dealt with by the web server.
Performance wise, if the user selects a wide date range, there can be up to 50,000 points plotted on the chart. The total time to retireve the web page in this scenario is about 8 seconds, of which half is due to JFreeChart and half Oracle. Generally the performance is good, on a 4 processor (Pentium 800's) with a couple of gig of RAM that is shared with a few other apps.
Overall I've had a good experience with JFreeChart, althugh I dount think I would use it as part of a business critical application.
I think I am doing a similar task to what you are trying to achieve. I have a servlet which pulls data from an Oracle database and generates a Time Series chart based on the time interval specified by the user. With each servlet request, an image is drawn with a specified name and saved to the /html folder on the weblogic server. The servlet then returns HTML with a simple image tag pointing to the image.
I have never had synchroniztion issues at all, this will all be dealt with by the web server.
Performance wise, if the user selects a wide date range, there can be up to 50,000 points plotted on the chart. The total time to retireve the web page in this scenario is about 8 seconds, of which half is due to JFreeChart and half Oracle. Generally the performance is good, on a 4 processor (Pentium 800's) with a couple of gig of RAM that is shared with a few other apps.
Overall I've had a good experience with JFreeChart, althugh I dount think I would use it as part of a business critical application.
Re: Servlets, Thread Syncronisation and Performance
Out of interest Adam, what charting solution would you consider using as part of a business critical application?
Richard...
Richard...