Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP versus C++
Message
From
28/10/2003 18:05:44
 
 
To
28/10/2003 17:04:17
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00842594
Message ID:
00843856
Views:
17
>>I really don't know how the optimization does it job. Just some thoughts, maybe it has an internal table to machine instruction of how much time the processor will take for each code. Does it generate a delay/stall for processor. Based on that it generate the fastest instruction. Just some thoughts :-)
>
>Well I'd be mightily p*ssed-off if it was something like that because if it already 'knows' which is fastest why wouldn't it use that in the first place???

Maybe it can be done for a simple program (a very small one). But I don't think it can't for a complex program. Now maybe this is the part where the optimization doesn't always succesful. Take an example. One line of C++ code can be transform into several line (one block) of op-code . It must calculate the total time the processor will take for that block of op-code.

When several line of op-code must be process to produce one result, there are other factor that must be concern about. Such as the one that I mentioned above. Will this block of op-code produce a stall or partial stall for the processor. furthermore which Registers that can be use for that block of op-code. The compiler cannot always use one register for the whole program to produce an exe. Different Register to use will produce different results.

So the compiler has to generate the fastest instruction, for any condition, from the beginning.
But again this is really just a thought

Regards
Herman
Previous
Reply
Map
View

Click here to load this message in the networking platform