LWN.net Logo

Facebook's "HipHop" PHP translator

Facebook's "HipHop" PHP translator

Posted Feb 2, 2010 23:28 UTC (Tue) by bk (guest, #25617)
In reply to: Facebook's "HipHop" PHP translator by ncm
Parent article: Facebook's "HipHop" PHP translator

Let:

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')


(Log in to post comments)

100%

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.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds