Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foxpro performance .vs. C program...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00036664
Message ID:
00037107
Vues:
34
>Hello !
>
>We have developed a VFP5 program called the Factory Commander that gathers data about a manufacturing process and produces reports indicating production results.
>
>The calculation phase of this program takes about ten times longer than our competitors who use C and Smalltalk. We have about 15 related tables and use SCAN/SEEK and SQL Selects to process the data and I believe we are maximizing the Rushmore technology.
>
>Any ideas on why our competitors are beating us using a 'database from scratch' in C ?

Peter,

As usual, the folks at the UT have given you some great advice. There's one factor, however, that they may have missed. Unfortunately, there's nothing that can be done about it.

XBase tables store all their data (with certain exceptions in memo and general fields) as ASCII characters. This means that at some point in the process this data has to be translated from character to 8 byte double precision floating point numbers for your numeric fields. By contrast, the C program may not have this overhead.

To optimize, the first place I'd look is at your iteration structures, especially at any that use an integer type counter to determine when the loop should terminate. FoxPro has to do at least four times the work that a C program would since there is no real integer type. When I translated a routine that I had written in QuickBASIC to FoxPro that heavily used interation structures, the QB program running on an 8 Mhz 80286 preformed it in seconds where the FoxPro version took minutes running on a 20 Mhz 386 to do exactly the same operations. One of the things I did in the redesign process was reduce the loops as much as possible.

You mentioned that data from different tables is used to perform the calculations. If these tables are engaged in a relation, and the key is numeric, look at using BINTOC() to store the key data as character.

Good Luck,

George
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform