HHVM sends PHP websites into the fast lane

lcube webhosting
2 min readMay 8, 2021
Server from Germany

Over 80% of all websites worldwide are operated with PHP.

The quick entry into the programming language ensures a great popularity among programmers. Whether quick&dirty or clean object-oriented. Everything is possible.

Large CMS or store systems use PHP. Modules for various database systems are available to manage data from PHP.

With almost every PHP update the programming language became faster but to run large stores with thousands of single PHP files the necessary performance is still missing. Because in the net applies: The faster a page, the lower the bounce rate of visitors.

So every millisecond is haggled over.

There are different approaches to increase the speed of PHP applications:

  1. Optimizing code
  2. Caching of data
  3. Caching of code

We assume that the code runs optimally because we only want to deal with 1 and 2.

Caching of data

There are several ways to cache data. Applications store data in the file system or memory and access them to not have to compute them again. Memcached is often used for this purpose. PHP can use Memcached to store data in RAM and access it very fast.

Varnish is also a popular page cache. With this, web pages do not need to be recalculated every time they are called, but are delivered from a cache.

Code caching

A PHP file is translated into a bytecode before each execution. If a PHP file is used frequently, this bytecode can be cached to save the time of translation (OpCode Cache).

The PHP accelerators can, in addition to caching the bytecode, also perform optimizations and increase the speed even more. There are different OpCode caches (eAccelerator, APC, Zend OpCache).

So what is HHVM?

HHVM (HipHopVirtualMachine) is a standalone program that first translates PHP files into ByteCode (HHBC). This ByteCode is dynamically compiled into machine code at runtime by a Jit compiler. Because HHVM has its own PHP implementation not all functions of the normal PHP version are supported.

This way a PHP application within HHVM can run much faster and more resource efficient than within a normal PHP interpreter.

Do you want to use a HHVM server? No problem. On our Root-, Managed-, SVN- and Git- as well as Shophosting Servers we can set up a HHVM for you.

If you have any questions write us

--

--

lcube webhosting
0 Followers

LCube Hosting is a professional provider of web hosting with modern servers in Germany.