I became interested in code optimisation when I read a post that Bryan had written commenting on the amount of time that optimisation of code could take and that good compilers were expensive.
My questions are based on my understanding that
a) All compilers make 2 passes, one to convert high level code into assembler and the second to convert assembler into machine code.
b)The conversion to assembler is the inefficient step because the compiler can't see the wood for the trees ? ie because the compiler does not know what the code is trying to do, it cannot produce efficient assembler.
1)Are a) and b) correct?
2)Is optimisation therefore based on optimising the code after the first compiler pass?
3)Can you predict by looking at the code the amount of time optimisation will take ie does well written code produce significantly better assembler than poorly written code?
4)Is it easier to optimise C than Delfi?
5)If some languages require less optimisation than others, what is the order of these languages?
6)I found that Bryan's optimisation of Fruit 2.1 produced an 8.5% speed increase over the unoptimised code. What speed advantage would well written assembler have over well written and compiled C?
7)What speed advantage would a top compiler give over a standard compiler such as Gcc?
8)Please suggest names and prices of top compilers.
Jack