User (Legacy) Posted September 13, 2002 Report Share Posted September 13, 2002 Hello Again I write today searching for performance enhancements, whether documented, undocumented, supported or unsupported. We use ChartFX IE 2000 on a web site where customers are allowed to create quite large graphical reports.. 50,000 to 100,000 data points on the fly, if not more. And these are run frequently (many every minute). On a recent rewrite, we moved to an XY plot of values VS time, which gave us some nice new output, but wow can it be slow (relatively speaking . Using the series object to set both the XValue and YValue, 4 series, each series having 10,000 data points, a sample chart may take 15 to 20 seconds. This may not seem like much, but when you have 30 concurrent users waiting for their turn on the server, 15 seconds is an eternity. Short of turning down each web guest's time slice at the IIS level, are their any tips or tricks you may know of to get a boost in performance. For example, I've already stopped using COD_ALLOCHIDDEN. Also, when doing an OpenDataEX, will the system perform faster if you specify row count as opposed to the -1 constant? Anyways, as always, any help is extremely appreciated. Thank you for all your time. Chris Friedel chris.friedel@zedisolutions.com Link to comment Share on other sites More sharing options...
Software FX Posted September 13, 2002 Report Share Posted September 13, 2002 One of the things you need to figure out first is which is more critical in your particular charts, setting the chart attributes and data or creating the images. I would recommend writing a VB app where you exercise code similar to the one used in your ASP pages. A VB app may give you more determinism since you won't have the threads/request/scheduling handling that ASP has. Then you may want use the High resolution API (QueryPerformanceCounter and QueryPerformanceFrequency) since a simple datetime may not be accurate enough. We wrote a very simple COM object that exposes this API that we can provide "as-is" but invoking these functions from VB should be very simple since they do not expect complex data structures. I would then measure the time it takes to set all properties and data against the time it takes to do GetHtmlTag/GetHtmlData/Export. If the bottleneck is setting properties you may try reading a prebuilt Chart file. Moving the code to a compiled COM object (VB, C++) may also help a little bit if the code parsing/interpreting done by ASP is hurting you. If the bottleneck is setting the data you may want to try specifying the exact row count in OpenDataEx, by doing this you will speed up things from a ChartFX perspective since memory won't have to be reallocated multiple times. The disadvantage of this approach is that for certain databases, querying a row count implies looping through the recordset so your mileage will definitely vary. If the bottleneck is the image generation (I suspect it will be) there are a number of things you can do to try to speed things up. e.g. Changing your server resolution from High-Color to 256 may help if you are generating palletized images. If you are OK with high-color images then setting the ImgColors property may also help you. Changing the PNG compression level will result in slightly larger images but will speed things up. There is a performance paper in our web site with detailed numbers and suggestions at http://www.softwarefx.com/SFXProducts/CfxInternet/ and click on the "Performance & Scalability Test" link. -- Regards, JC Software FX Support "Chris Friedel" <chris.friedel@zedisolutions.com> wrote in message news:ZLEHIg2WCHA.3136@webserver1.softwarefx.com... > Hello Again > > I write today searching for performance enhancements, whether documented, > undocumented, supported or unsupported. > > We use ChartFX IE 2000 on a web site where customers are allowed to create > quite large graphical reports.. 50,000 to 100,000 data points on the fly, if > not more. And these are run frequently (many every minute). > > On a recent rewrite, we moved to an XY plot of values VS time, which gave us > some nice new output, but wow can it be slow (relatively speaking . > > Using the series object to set both the XValue and YValue, 4 series, each > series having 10,000 data points, a sample chart may take 15 to 20 seconds. > This may not seem like much, but when you have 30 concurrent users waiting > for their turn on the server, 15 seconds is an eternity. Short of turning > down each web guest's time slice at the IIS level, are their any tips or > tricks you may know of to get a boost in performance. > > For example, I've already stopped using COD_ALLOCHIDDEN. > > Also, when doing an OpenDataEX, will the system perform faster if you > specify row count as opposed to the -1 constant? > > Anyways, as always, any help is extremely appreciated. Thank you for all > your time. > > Chris Friedel > chris.friedel@zedisolutions.com > > Link to comment Share on other sites More sharing options...
User (Legacy) Posted September 16, 2002 Author Report Share Posted September 16, 2002 First off, I'd just like to say thanks to JC and all of Software FX support for all the great work you do on the message boards. I know having users ask the same questions over and over all day can get frustrating, and I value the effort you are always putting into it. Now, onto those questions us users keep asking over and over Some of the suggestions here were great, while some I couldn't implement due to the constraints and requirements of our own applications. Cutting down the color resolution worked wonders for image generation speeds by the way, thank you. I still have two distinct questions that I have not been able to find the answers to on the website or in the documentation, and was hopping someone could answer them here. 1) The first is on opening channels. In the ASP page in question, the script flow looks something like this: //******************************************************* cfxChart.OpenDataEX (COD_VALUES, iSeriesCount,-1); cfxChart.OpenDataEX (COD_COLORS, iSeriesCount,0); cfxChart.OpenDataEX (COD_XVALUES, iSeriesCount,-1); // Lots of code goes here to creates legends, axis min/max, labels, X axis date ranges, and such things // The code here runs very fast. cfxChart.CloseData (COD_VALUES); cfxChart.CloseData (COD_COLORS); cfxChart.CloseData (COD_XVALUES); cfxChart.OpenDataEX (COD_VALUES, iSeriesCount,-1); cfxChart.OpenDataEX (COD_XVALUES, iSeriesCount,-1); // Series().XValue and Series().YValue calls go here to set data in the XY plot. // This is where my bottle neck is. cfxChart.CloseData(COD_XVALUES); cfxChart.CloseData(COD_VALUES); //******************************************************* The code above works fine and I thought it was correct. However, when cleaning up code, I attempted to make the following change, essentially leaving the data channels open the whole time. //******************************************************* cfxChart.OpenDataEX (COD_VALUES, iSeriesCount,-1); cfxChart.OpenDataEX (COD_COLORS, iSeriesCount,0); cfxChart.OpenDataEX (COD_XVALUES, iSeriesCount,-1); // Lots of code goes here to creates legends, axis min/max, labels, X axis date ranges, and such things // The code here runs very fast. cfxChart.CloseData (COD_COLORS); //Believing it would make no difference, I did not close and reopen the X data and Y data channels, thinking I may gain a performance boost by leaving them open. //This caused an increase in time to set data almost 2X!! //cfxChart.CloseData (COD_VALUES); //cfxChart.CloseData (COD_XVALUES); //cfxChart.OpenDataEX (COD_VALUES, iSeriesCount,-1); //cfxChart.OpenDataEX (COD_XVALUES, iSeriesCount,-1); // Series().XValue and Series().YValue calls go here to set data in the XY plot. // This is where my bottle neck is. cfxChart.CloseData(COD_XVALUES); cfxChart.CloseData(COD_VALUES); //******************************************************* Much to my surprise, after the change the YValue and XValue calls then took DOUBLE the time to run. This is not a problem, as I simply changed the code back, but it got me thinking perhaps I am doing something wrong with my OpenDataEX calls. Usually, when changing code the way I did causes such a drastic problem, it means you've already got a problem in the first place. Also, if changing the way I opened and closed the channels slowed things down so much, do you see a way I could change my handling of channels to actually speed things up? 2) The second was the speed of adding data points. I have found it takes about 2500 - 3500 ms to add 7200 data points to an XY plot. This time is basically evenly split between the Series().XValue and Series.YValue calls (1250 - 1750 ms each). I have tried giving the row count in OpenDataEX instead of COD_UNKNOWN as well as enabling and disabling auto ranging, and neither of these affects the call speeds at all. Removing the style COD_ALLOCHIDDEN from the OpenDataEX call did cut the time down by about half for the first series, and a little bit for each series after that, but other than that I have not been able to affect the call time at all. (Except for the performance issue I had in my first question above.) Does 2.5 to 3.5 seconds for 7200 XY plots sound reasonable? My fear is that either auto ranging is still on for some reason, even though I have disabled it with the API (I believe this because turning auto ranging back on seems to have no performance impact), or that something in the way I am calling OpenDataEX is causing extra processing to occur on each XValue and YValue call. Commenting out both of those calls (XValue and YValue) cuts the speed of the loop to about 10ms for 36000 loops. I hope both of these questions make sense. I've spent a fair bit of time looking for the answers to either, and hopefully its not too much of a burden to ask them here. Thanks again for all the help. Chris Friedel chris.friedel@zedisolutions.com "Software FX Support" <support@softwarefx.com> wrote in message news:KO4D9I3WCHA.3136@webserver1.softwarefx.com... > One of the things you need to figure out first is which is more critical in > your particular charts, setting the chart attributes and data or creating > the images. I would recommend writing a VB app where you exercise code > similar to the one used in your ASP pages. A VB app may give you more > determinism since you won't have the threads/request/scheduling handling > that ASP has. > > Then you may want use the High resolution API (QueryPerformanceCounter and > QueryPerformanceFrequency) since a simple datetime may not be accurate > enough. We wrote a very simple COM object that exposes this API that we can > provide "as-is" but invoking these functions from VB should be very simple > since they do not expect complex data structures. > > I would then measure the time it takes to set all properties and data > against the time it takes to do GetHtmlTag/GetHtmlData/Export. > > If the bottleneck is setting properties you may try reading a prebuilt Chart > file. Moving the code to a compiled COM object (VB, C++) may also help a > little bit if the code parsing/interpreting done by ASP is hurting you. > > If the bottleneck is setting the data you may want to try specifying the > exact row count in OpenDataEx, by doing this you will speed up things from a > ChartFX perspective since memory won't have to be reallocated multiple > times. The disadvantage of this approach is that for certain databases, > querying a row count implies looping through the recordset so your mileage > will definitely vary. > > If the bottleneck is the image generation (I suspect it will be) there are a > number of things you can do to try to speed things up. e.g. Changing your > server resolution from High-Color to 256 may help if you are generating > palletized images. If you are OK with high-color images then setting the > ImgColors property may also help you. Changing the PNG compression level > will result in slightly larger images but will speed things up. There is a > performance paper in our web site with detailed numbers and suggestions at > http://www.softwarefx.com/SFXProducts/CfxInternet/ and click on the > "Performance & Scalability Test" link. > > -- > Regards, > > JC > Software FX Support > "Chris Friedel" <chris.friedel@zedisolutions.com> wrote in message > news:ZLEHIg2WCHA.3136@webserver1.softwarefx.com... > > Hello Again > > > > I write today searching for performance enhancements, whether documented, > > undocumented, supported or unsupported. > > > > We use ChartFX IE 2000 on a web site where customers are allowed to create > > quite large graphical reports.. 50,000 to 100,000 data points on the fly, > if > > not more. And these are run frequently (many every minute). > > > > On a recent rewrite, we moved to an XY plot of values VS time, which gave > us > > some nice new output, but wow can it be slow (relatively speaking . > > > > Using the series object to set both the XValue and YValue, 4 series, each > > series having 10,000 data points, a sample chart may take 15 to 20 > seconds. > > This may not seem like much, but when you have 30 concurrent users waiting > > for their turn on the server, 15 seconds is an eternity. Short of turning > > down each web guest's time slice at the IIS level, are their any tips or > > tricks you may know of to get a boost in performance. > > > > For example, I've already stopped using COD_ALLOCHIDDEN. > > > > Also, when doing an OpenDataEX, will the system perform faster if you > > specify row count as opposed to the -1 constant? > > > > Anyways, as always, any help is extremely appreciated. Thank you for all > > your time. > > > > Chris Friedel > > chris.friedel@zedisolutions.com > > > > > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.