Foxcharts Running Very Slow

Topics: General
Dec 6, 2009 at 9:12 AM

I have Foxcharts running in a single sample form that I created, and it's great and plenty fast (less than a second). But, when I load into my application, the same chart takes 25 seconds to draw. I traced the delay to the method where the dougnut slice is being drawn. Just have no idea why this is so much slower running inside my app.



Dec 7, 2009 at 2:36 PM

Hi Bill,

Can you tell me which gdiplus.dll versions you are using in each machine ?

Dec 7, 2009 at 5:57 PM


Part of the problem alleviated. If I run my application within the VFP IDE it's much much slower. If I run the exe outside of the VFP IDE the pie chart draws acceptably fast. The bar chart is instantaneous, and the pie chart maybe a 1-2 second delay. Is there some dev setting that might cause this?

My gdiplus.dll verions is 5.1.3102.1360. The file is from 2004. I suspect there is a later and greater version? I am running XP... i read somewhere that SP2 or later would have the latest. I am running SP3 and interestingly there was no gdiplus.dll in my system32 folder. I have a copy in my app root folder.

Thanks for your help.


Dec 9, 2009 at 9:33 AM

A few thoughts/questions...

What is the machine this is running on like performance-wise? How much ram (how much to spare), how fast a processor as well as overall CPU load, what kind of graphics card we looking at here?

Are you perhaps running your exe in VFP with the debug window open? Coverage profiler on or some sort of logging or anything you've got turned on when _vfp.startmode = 0?

Does your application turn off off-screen bitmaps using Sys(602)?

I suspect a combination of the first and second above. Running an application in VFP is always going to use more resources than just running the application, and if this box you have it installed on is already starving for ram, cpu... all bets are off as to performance.

I dunno if you've looked at the code that is drawing those pie chart slices (both in FoxCharts and, by extension, GdiplusX), but there's a lot going on there.

OK, so let's pretend that you get back to me hear and say that the machine is a monster and definitely not lacking in resources... then I'd do two things... first run out a list of your system settings from VFP and then from in your standalone application and compare them... take a look at LIST STATUS for this. If that fails to shed any light on it, fire up the coverage profiler and find out what is taking so long (specific lines of code) and then work backwards from there until you find a solution or get stuck. In either event, you could come back here and we could discuss it further.

Dec 9, 2009 at 1:32 PM

Hi Craig,

Thanks for your help.

Some time ago, I found that the GraphicsPath from Gdiplus.dll would behave differently in some versions, bringing a huge difference of performance. I noticed that in design time, the gdiplus.dll version is the one that is in the same folder where the VFP DLLs reside. But when the executable runs, the OS uses the first it finds. Is that correct ?

I'm almost sure that this is a gdiplus.dll issue, maybe if he renames all the gdiplus.dll files from that machine, leaving just one intact, preferrably the one that ships with VFP9, we could have this solved.

Dec 11, 2009 at 4:59 PM

Thanks for your help.

1. Machine AMD 3200+, 1GB RAM, Nvidia 7600 GEForce 256 MB RAM. Left 4 Dead runs just fine with zombie quality on high :).

2. Debugging. Logging. Coverage profiler. No.

3. Sys(602). Setting = 1 

I had first started learning and testing foxchart using my little stock portfolio tracking app. Running that application, running in VFP, running outside VFP, running on numerous machines, all foxcharts run fast, regardless of chart type or number of bars or pie slices.

Running my companies production app, on a variety of machines, all exhibit the same behavior.

Regarding gdiplus.dll. What is the best version to run and where is the best place to put that a single copy? My version is 5.1.3102.2180.

Let's go back to the behaviour I'm seeing in my companies app. If I run a bar chart, of any complexity, it's fast. If I continue to draw bar charts, of varying complexity, over and over, it's very fast. If I switch to a pie chart, with say 18 slices, I can go get a cup of coffee before it will finish drawing. Then, if a switch the type back to bar (this is all programmatic), same cursor, I can go get another cup of coffee. So this is one the key baffling aspects. Why would a bar chart draw in less than a sec, then take 25 seconds when drawn after the last chart drawn was a pie chart? We're running the same code, yes?

If the gdiplus pathing was an issue (or anything with gdiplus), or this was a resource issue, then  I would think my small sample application would exhibit similar behavior as my companies application (the company app is medium size... less of a footprint than most things running on my machine). So it must be some setting in the app. So next I will try to a status check running the sample app versus my companies app. Try to find some difference.


Dec 11, 2009 at 5:07 PM

..quick follow up. The exteme slowness only happens when running the company app in VFP IDE. Outside of the IDE the switch between pie and bar is slow, but nowhere near as slow.


Dec 11, 2009 at 5:09 PM



Pklease follow my instruction in the other thread, creating an EXE from the FoxCharts samples, and run it in some machines, and tell me how it goes,.

Dec 11, 2009 at 7:20 PM

Runs great. No problems. All machines.

Dec 12, 2009 at 12:25 AM
Edited Dec 12, 2009 at 12:32 AM

Thanks Bill

Did you test the main sample, the builder, from the EXE as well ? Please give it a try, also swithcing from graphic types.


FYI, I have FoxCharts running fine in a 8 years old Intel Celeron 300 computer, with 128 Mb RAM, running under WinNT4.0 SP6 - THat means that we have to understand what is going wrong at your side.

Your last experiment, running the Samples in an EXE tells me that there might be something wrong in your script for generating the charts, and also to change the chart style. Can you create a small project with one problematic form and send it to me ? vfpimaging at hotmailnospam dot com

There's also another thing that I want you to test. Please set the property "PieEnhancedDrawing" to False, something like the code below.

Thisform.FoxCharts1.PieEnhancedDrawing = .F.

That will make the Pies and Doughnut charts not to use the GraphicsPath related classes, that can be the origin of your problem.

Hope to hear from you !

Dec 14, 2009 at 1:31 PM

Yes, agreed computer resources are not the issue.

I tried setting PieEnhancedDrawing = .F. ... didn't help.

Again, I am not seeing any problems running foxcharts in any of my sample applications or your sample applications. My sample applications use the exact same script as the version that's running inside my companies app.

I will try to get you a small project showing you how i'm running things. Might take a few days as I have to backburner this for now.

Thanks for your help.


Nov 17, 2012 at 9:46 AM

I noticed that the method _setup and _Updatemeasure is called several times, in particular the method which is very slow is MeasureString.
Replacing the call MeasureString with a method FOX, less precise but faster, the coverage indicates a decline in average redraw the image to be to
It's not much but it is a starting point
Now I start to study these cakes are very slow
This tool is very nice try to make it go as fast as the wind
PS: A solution to speed it would, you might think to create a library minimalist call APIs directly without using in gdiplus.dll which is really slow
What do you think?
See you soon