Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

HipHop Blog:
Faster and Cheaper: The Evolution of the hhvm JIT
Dec 12, 2013 @ 18:09:35

On the HHVM (HipHop Virtal Machine) blog there's a new post that looks at the evolution of the HHVM JIT compiler since the project started about four years ago.

When the hhvm project was started almost 4 years ago, it had a two-part mandate: First, create a PHP JIT that could serve facebook.com at least as efficiently as hphpc, the PHP execution engine we were using at the time. Second, replace hphpi, the interpreter our PHP developers were using in their daily work. hphpc and hphpi were independent pieces of software with unintentional subtle differences in behavior and a significant maintenance burden. Unifying the execution engines used in production and development would make our jobs easier while giving the PHP devs a nicer experience at the same time.

The article goes on to talk about their needs from the environment and the basics of how the JIT compiler works to "translate" the code into something more low level than even C++. They chart out the performance of the HHVM versus the HPPC, showing a major growth around the end of the last year and continuing into this year. They also give an example of how this translation happens from a PHP script to bytecode to the translated result from their "TranslatorX64" tool.

tagged: hhvm jit compiler justintime history hphpc facebook

Link: http://www.hhvm.com/blog/2027/faster-and-cheaper-the-evolution-of-the-hhvm-jit

Allan MacGregor:
An Introduction to HHVM
Jul 26, 2013 @ 15:24:52

Allan MacGregor has posted a (high level) introduction to the HipHop Virtual Machine (HHVM) that was created by Facebook to address some of their PHP-related needs inside their platform. It sacrifices some things in the name of speed and less resource consumption.

In early 2008 Facebook began working on HipHop(now HPHP), a PHP execution engine; its original motivation was to convert Facebook massive PHP code base into C++ in order to save resources and increase the application performance. [...] At it’s peak, HipHop PHP code showed up to 6x times better performance than its ZEND counterpart. However, there where several drawbacks to this first iteration of HipHop. [...] At the same time Facebook started the development of the modern version of HipHop, known as HHVM (HipHop Virtual Machine), HHVM improves the strengths of HPHPc and corrects many of the critical problems.

He talks some about Facebook's efforts to open source the platform and what the HipHop VM does to make your PHP code execute that much faster. It's all about bytecode, machine code and a JIT (just in time) compiler where the bytecode is parsed during execution instead of before.

Currently HHVM supports PHP 5.4 almost on its entirety, however there are still numerous bugs that prevent some applications from running, for that reason Facebook has set as goal to have the top 20 open source PHP applications running on HHVM. The first popular application to achieve this was Wordpress.
tagged: introduction hhvm hiphop virtual machine facebook bytecode jit compiler

Link: http://coderoncode.com/2013/07/24/introduction-hhvm.html

PHPClasses.org:
Lately in PHP, Episode 30 - Will PHP 6 feature a JIT compiler?
Dec 10, 2012 @ 16:50:28

On the PHPClasses.org site they've posted the latest episode of their "Lately in PHP" podcast series - Episode #30, "Will PHP6 Feature a JIT compiler?"

Now that Facebook made some progress with their PHP HipHop VM JIT compiler engine, some PHP core developers are considering having also a JIT compiler implementation of the official implementation based on LLVM, eventually in PHP 6. [...] They also commented on the first alpha release of PHP 5.5.0, proposals for having pure interfaces in the PHP core, the Facebook PHP JIT compiler enhancements, and the new system of levels and missions of the PHPClasses and JSClasses sites.

You can listen to this latest episode either through their in-page player, by downloading the mp3 or by subscribing to their feed. You can also watch the video of the recording as well.

tagged: latelyinphp podcast jit compiler alpha release video

Link:

PHPClasses.org:
Lately in PHP Podcast Episode 19 - The Debate of Making PHP Faster using a JIT
Jan 05, 2012 @ 18:31:31

On PHPClasses.org today the latest episode (#19) of the "Lately in PHP" podcast has been posted. In it Manual Lemos and Ernani Joppert: talk about the concept of a JIT (just in time) compiler for PHP (such as HipHop or Phalanger).

JIT compilation is the main topic of the episode 19 of the Lately in PHP podcast presented by Manuel Lemos and Ernani Joppert who received as guests Miloslav Beno of the Phalanger team and Nuno Lopes of the PECL LLVM project to discuss this and other interesting topics of the PHP scene.

The hosts and their guests talk about compiling PHP, things that happened in 2011 and look forward to what's to come in the world of PHP in 2012. You can listen to this latest episode either via the in-page player, by downloading the mp3 or by subscribing to the podcast feed.

tagged: latelyinphp podcast compile language justintime jit interview

Link:

ReadWriteWeb.com:
CONFIRMED: Facebook Gets Faster, Debuts Homegrown PHP Compiler
Feb 02, 2010 @ 16:45:12

If you've been following along with some of the articles about the compiler Facebook is developing for PHP, you might want to check out these comments from ReadWriteWeb.com (by Mike Melanson) with more from his point of view.

According to our sources, Facebook has been working on a PHP compiler that will increase speed by around 80% and offer a just-in-time (JIT) compilation engine that will offer a number of advantages. The project is very similar to Google's Unladen Swallow project, which rebuilt the Python compiler, boosting the speed fivefold and opening the door for multi-language integration.

Included are also some comments from Richard Crowley about what Facebook could be releasing, a compiler that would still allow PHP to remain interpreted but provide the speed of being compiled. Some of the comments on the post wonder how something like this compiler compares to an opcode cache and doubts on whether it will end up being open sourced at all.

You can also get another opinion on what will be released in this article from the All Facebook blog. They reinforce that the announcement will come today and how much potential something like this could have to change what PHP could become.

tagged: compiler facebook rumor jit

Link:

PHPImpact Blog:
PHP Compiler for the .NET Framework
Jun 04, 2008 @ 13:48:47

This post on the PHPImpact blog talks about a compiler that helps to bridge some of the gap between PHP and .NET - Phlanger.

Phalanger is a new PHP implementation introducing the PHP language into the family of compiled .NET languages. [...] Phalanger compiles PHP scripts into MSIL (Microsoft Intermediate Language) which can be executed by .NET or Mono runtime.

He mentions some of the features of the tool (including interoperability between .NET and PHP and the ability to use current PHP libraries inside the .NET application). More information can be found on the Phlanger website.

tagged: phlanger compile dotnet framework msil jit microsoft intermediate language

Link:

Jacob Santos' Blog:
Would PHP benefit from JIT compilation?
Mar 27, 2007 @ 15:52:00

In this post from his blog, Jacob Santos asks the question "would PHP benefit from JIT compilation?"

JIT (just in time) compilation is, according to Wikipedia, a method for converting, at runtime, code from one format into another, for example bytecode into native machine code. To try to see the benefit of this, Jacob asks four questions in his post (each with their own problems):

  • Q: What advantage over opcode caching is gained?
    P: A JIT library that works with PHP would have to support all of the architectures that PHP can run on!
  • Q: Which JIT library is the best one?
    P: A JIT compiler is not going to achieve anything without either storing the results or caching them.
  • Q: Wouldn't writing PHP extensions negate the need for JIT compilation?
  • Q: When will I develop and release my implementation?
Check out the comments for some great thoughts from others about this kind of compilation.

tagged: jit compilation benefit question problem opcode support extension jit compilation benefit question problem opcode support extension

Link:

Jacob Santos' Blog:
Would PHP benefit from JIT compilation?
Mar 27, 2007 @ 15:52:00

In this post from his blog, Jacob Santos asks the question "would PHP benefit from JIT compilation?"

JIT (just in time) compilation is, according to Wikipedia, a method for converting, at runtime, code from one format into another, for example bytecode into native machine code. To try to see the benefit of this, Jacob asks four questions in his post (each with their own problems):

  • Q: What advantage over opcode caching is gained?
    P: A JIT library that works with PHP would have to support all of the architectures that PHP can run on!
  • Q: Which JIT library is the best one?
    P: A JIT compiler is not going to achieve anything without either storing the results or caching them.
  • Q: Wouldn't writing PHP extensions negate the need for JIT compilation?
  • Q: When will I develop and release my implementation?
Check out the comments for some great thoughts from others about this kind of compilation.

tagged: jit compilation benefit question problem opcode support extension jit compilation benefit question problem opcode support extension

Link:


Trending Topics: