views:

193

answers:

5

I have a high-speed ADC data capture/analysis program which performs poorly on older computers. This was discovered in beta testing in my customer's lab when one test engineer reported the application was hanging. It turns out that she had an old computer in her lab (single core P4), and the 'hang' was the computer taking a very long time to complete some calculations.

I would like to calculate "computing power" at startup, and warn the customer that some functions will be very slow if the calculated power is below some cut-off point. Note that CPU speed isn't what I'm after (the P4 was running at 2.4 GHz).

I thought that I could just get the CPU family/model/stepping and show the warning if the family/model was below some cut-off point, but I don't think this approach is workable because the family for the P4 is higher than the family for, say, an i7. Using a table is out because the table will have to be maintained.

I could use a benchmark algorithm such as whetstone/Dhrystone/whatever, but I don't want to add any more time to startup than necessary.

Is there another way I can accomplish this without taking an inordinate amount of time at start-up?

TIA

+6  A: 

It's probably best to run a small actual calculation (with some included sample data) and time the operation.

As for the startup time concern, you could either do the testing during the installer, or run it on startup only the first time that it hasn't been run (and then store a flag indicating that it has been run).

Andrew Medico
Be very careful with that as if the calculation is too trivial the compiler might just simply optimize it out.
DrJokepu
No! Bad idea! Assumes data sample will continue to be representative.
wefwfwefwe
Good idea! It does assume that, but using the real calculation is better than any other idea.
Zan Lynx
I like this one, and accept your answer because you thought to store a flag holding the test results. Thanks!Now, on to finding the best calc algorithm...
casterle
+2  A: 

Rather than running a check at start-up, create an install for your application and run the check and requisite warnings then.

I agree maintaining a table of suitable and unsuitable chips would be a pain. I would stick with which ever benchmark algorithm most closely tracks with the type of calculations your program will be performing and set a minimum score that will prevent installation.

Rob Allen
I like the idea of doing the calcs during installation.
casterle
+4  A: 

Have a progress bar or similar so that there's some feedback that the app hasn't crashed.

(e.g. in the future your computer may be twice as fast but your dataset 30 times larger. The computer that you once considered fast now looks like it's died)

wefwfwefwe
I like progress bar idea, but don't have access to progress info (the calcs are done in a library). But the library is written in-house, so I could perhaps get the author to provide me with this info.
casterle
An activity wheel (not sure if that's the right name - I'm referring to one of those circular thingies that goes 'round and 'round while something is happening) could be used if I can't get progress info.
casterle
A: 

In combination with some of the ideas of running a little benchmark function of your own using your real calculation and sample data, I think it would be clever to offer the user the chance to upload the results to your web site. Your web site could then display charts showing the results of many combinations of CPU type and speed. That would enable new users of your program to know what sort of system they need before installing the program.

Zan Lynx
That's an interesting thought and might be a good idea for a different app. This one is specialized such that the user base is in the 100's (at most) so the sample size would be limited. At any rate, I don't think my manager would go along with taking time to do anything that's 'unnecessary'.
casterle
A: 

If we designed the front-end (UI) and the back-end (functionality) in the right way, even if the calculation is slow, neither the program, nor the computer shall hang.

I would suggest that you use multi-threading to overcome this hang issue, rather than the warning, which you can be sure that most of the people will just ignore, till they see the actual hang.

This answer may be way off your question, but just a suggestion.

Alphaneo
The app is already multi-threaded. The problem is that the results cannot be displayed until the calculations are completed, and the users report this as a 'hang' even though the UI is responsive.
casterle