Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP versus C++
Message
De
29/10/2003 04:12:29
 
 
À
28/10/2003 17:04:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00842594
Message ID:
00843950
Vues:
23
Jim,

Optimisation is not as simple as replacing a byte sized opcode with words and so on an so forth. Look at the following list of optimisations most modern C++ compilers can perform.

global register allocation
instruction scheduling
register variable detection
common subexpression elimination
dead-code elimination
variable renaming
copy propagation
constant propagation
strength reduction-induction variable
tail recursion elimination
software pipelining and vectorisation

The optimiser has to use a number of strategies to work out best plan, this includes generating profiling information regarding common branch targets, function call frequency and dynamic loop iterations counts. Depending on the compiler you can also provide "hints" to aid in optimisation strategies such as loading of the instruction pipeline or data into the cache.

An common example of where the optimiser will not be able to do its job is the use of registers for the parameter list. Registers are a finite resource, passing in lots of parameters and expecting the compiler to be able to use registers is just not going to happen, however, pass in a pointer to a structure as a single parameter and the optimiser can help you.

Regards
Neil
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform