Re:Facebook makes HipHop for PHP open source
by angelbob on Tuesday February 02, 2010 @03:59PM
(#1096092)
Hand-coded C++ is much more than twice as fast, but 2x is what you get from machine-converted HipHop at this point.
Re:Facebook makes HipHop for PHP open source
by Todd on Tuesday February 02, 2010 @06:38PM
(#1096552)
Agreed. Scripted/interpreted languages are, in general, one to two orders of magnitude slower than a compiled language such as C/C++. It's damn difficult to go much better than 10x slower due to the nature of an interpreter--even fast opcode-based interpreters. There are some extensions to the GNU C/C++ compilers that can help here, though.
Re:Facebook makes HipHop for PHP open source
by jwr on Tuesday February 02, 2010 @05:00PM
(#1096293)
Languages aren't "fast" or "slow", it's programs that can be fast or slow.
If a higher-level language lets you implement a smarter algorithm, your program will run faster.
Re:Facebook makes HipHop for PHP open source
by acangiano on Tuesday February 02, 2010 @06:51PM
(#1096596)
> Languages aren't "fast" or "slow", it's programs that can be fast or slow.
We can say that "C++ is faster than PHP", because most, if not all, programs using the same algorithms will run faster when written in C++ and compiled to native code.
> If a higher-level language lets you implement a smarter algorithm, your program will run faster.
PHP is generally easier to master than C++, but both are high level enough to provide adequate tools to write efficient algorithms with comparable amount of effort, provided one is competent with the language at hand.
C++ is much faster than PHP, not just twice as fast.