PHP twice as fast? Has anyone used this, yet?
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #1
PHP twice as fast? Has anyone used this, yet?
This is a PHP compiler that gives over 2x speed improvements...

Anyone here heard of 'HPHP' / or used it yet?
  • 2x faster, really?


Edit: FYI:
The fact there are so many PHP compilers illustrates a point – the mainstream PHP implementation (Zend) is inherently a sub-optimal design. It isn't multi-threaded, which means it relies on multiple processes to dispatch requests – which means a lot more memory and process juggling than you'd ideally have...
~same source
(This post was last modified: 10-08-2010 03:44 PM by Firefox Wins.)
10-08-2010 03:39 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: PHP twice as fast? Has anyone used this, yet?
HipHop compiles the script to a native language, so I'm actually surprised it only gets a 2x speed gain.
Compiled C++ can usually run many times faster than interpreted PHP, but a converter will never be as efficient as hand crafted code.

Then again, it comes at some costs I believe, such as not supporting the eval statement (so MyBB won't work, although if that's its only shortcoming, it may be patchable).
I would expect an opcode cacher like Xcache to provide most of the benefits of a static compiler like this without that much of a cost.


(10-08-2010 03:39 PM)Firefox Wins Wrote:   It isn't multi-threaded, which means it relies on multiple processes to dispatch requests – which means a lot more memory and process juggling than you'd ideally have...
~same source
Only really beneficial if you're running a single process multi-threaded webserver.
I'm not sure how this interfaces, but I believe CGI and FastCGI interfaces require a process per request.  So having a multi-threaded endpoint handler isn't that beneficial for any serious webserver (besides, this is static compilation, so mostly irrelevant anyway).

My Blog
(This post was last modified: 10-08-2010 04:24 PM by ZiNgA BuRgA.)
10-08-2010 04:23 PM
Find all posts by this user Quote this message in a reply
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #3
RE: PHP twice as fast? Has anyone used this, yet?
On one level I understand almost everything you said; To really master the subject will take a bit longer.   Smile
10-08-2010 07:58 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: