A be a theoretical 100% perfectly optimizing C++ to machine code compiler
B be a theoretical 100% perfectly optimizing PHP to C++ "code transformer"/compiler
C be a theoretical 100% perfectly optimizing PHP to machine code compiler
...would it not be true that A + B = C ?
(IOW, there need not necessarily be 'lost optimization opportunities')
Posted Feb 3, 2010 0:33 UTC (Wed) by ncm (subscriber, #165)
[Link]
No. If the A knew that its input could only come from B, then A could apply additional optimizations forbidden for the general case. However, the construct "100% perfectly optimizing" is strictly meaningless; many optimizations imply tradeoffs, potentially slowing down unlikely sequences in exchange for improving more common ones.