Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP versus C++
Message
From
29/10/2003 04:12:29
 
 
To
28/10/2003 17:04:17
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00842594
Message ID:
00843950
Views:
22
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform