HHVM, high-performance PHP execution engine

Source: Internet
Author: User

HHVM (HipHop Virtual machine) is Facebook's open source PHP execution engine. HHVM uses a JIT (just-in-time) compilation mechanism to achieve high performance while maintaining full support for PHP syntax. In real-world Facebook scenarios, the HHVM achieves 9 times times higher throughput and 5 times times more memory savings than Zend PHP 5.2 engine + APC.
The HHVM can be run as a standalone webserver, or it can provide a fastcgi interface that hangs underneath the webserver.
Official blog: http://www.hhvm.com
Github:https://github.com/facebook/hhvm

Some post-bar questions and answers: Reference bar: HTTP://TIEBA.BAIDU.COM/F?KW=HHVM

1 lighttpd collocation HHVM?

  This is also possible. If you are using the HHVM fastcgi protocol, simply change the php-cgi address in the LIGHTTPD configuration to the HHVM listening port or the UNIX socket address

2 hhvm run PHP script slower than Zend What's going on?

1. First check your configuration items, must be set eval.jit=1 the Jit will be opened to be fast, such as Hhvm-veval.jit=1 test.php
2. It doesn't make sense if you use the time command to clock, such as the result of time HHVM test.php and test.php PHP, because it contains HHVM compiling the PHP code and JIT compiling, rather than running time. The total look at this time HHVM is slower because more time is spent compiling. To test the run time, you can print it in PHP script with gettimeofday timing.
3. If you are using server mode, Note that the eval.jitwarmuprequests option, which defaults to 11, means that the first 11 requests do not use JIT mode execution (easy to do some types of collection), starting with the 12th request to start the JIT, so the first 11 requests are slow, the 12th request to see the real performance. You can set the eval.jitwarmuprequests to 0 so that it will always be executed in JIT mode.
4. If you are compiling your own HHVM, it will be compiled with the release mode, debug mode compiled out of poor performance.

3 PHP Performance Analysis

Xhprof is a good tool for PHP performance analysis
HHVM has built-in xhprof related functions, but you need to turn on the compile option to use
Modify the Cmake/options.cmake file to change the off of option (Hotprofiler "Enable for the Hot-profiler" off) to On
The other usage is the same as the Zend version, see Xhprof's documentation

4 the relationship between HHVM and hiphop?

Hiphop was previously developed by Facebook to convert PHP into C + + code compiler, also known as the hphpc,php->c++-> binary program->run, because pre-compiled so must sacrifice some of PHP dynamic features (such as Eval); You need to compile the C + + program online and then deploy it to line execution.
HHVM is a PHP execution engine,php->bytecode-> (JIT) binary code-> execution, also supports direct execution of bytecode (interpreter mode), which can be switched at any time, thus supporting the full PHP feature deployment, direct deployment of PHP code to the line can be, HHVM will automatically detect code modification and recompile

Why is the performance of 5 HHVM higher than the Zend engine?

http://tieba.baidu.com/p/2902029974

HHVM, high-performance PHP execution engine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.