Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP versus C++
Message
De
25/10/2003 13:01:00
Walter Meester
HoogkarspelPays-Bas
 
 
À
25/10/2003 10:26:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00842594
Message ID:
00842620
Vues:
20
Hoi peter,

My opinion is that indeed using another programming language like C/C++ is going to faster *if* you´re experienced with this programming environment.

The main reason for this lies in the fact VFP is a interpretated language. Though string functions in VFP are pretty fast, each VFP function in your routine has to be intepretated. When your program runs trough a lot VFP code the interpretator does a lot of work to read the PCODE analyze it and execute the underlying C++ code. If you compare the time that is needed to intepretate FAST vfp command with the time the underlying C/C++ code needs you´ll find that the overhead is tremendous. If you take complex commands (like SQL - SELECT) the time that is needed to intepretate it, is nothing compared to the time the underlying C/C++ needs to execute.

For these commands you´ll likely not find much speed difference whether you use a low or high level programming language.


A native compiled routine does not have the overhead of the interpretator and therefore is faster by definition. Also as you´re working on much lower level you can optimize your routines a lot better.

Of course the power of VFP is that you can program such routines pretty quickly while in lower level environments it generally takes more programming lines and time to do the same.

Walter,

>Hi to all who are interested in this topic.
>
>One of my customers has a colleague who states that the application that I've written should be written in C++, which would give a better performance. I wonder whether he's right and if not, what arguments I could use.
>
>The core of the app hardly uses DBMS functions. Instead, it uses low-level functions like FOPEN(), FGETS() and FPUTS(), and string manipulation functions like STRTRAN(). It reads tab delimited files, not with APPEND FROM, but with FGETS(). The reason is that the fields of the import files vary and the file size can be huge. And it also writes files with FPUTS() after having done some sophisticated string manipulation. The speed is still phenominal, thousands of records/lines are processed in a second or so. But the import files can contain 100,000,000 records or even more, so it may still take a while before they're all processed.
>
>The big question now is: Will C++ or Delphi do this job significantly faster??
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform