php 7.3 benchmark

We implement PHP 7.3 and compare it with other versions

From today our servers works the latest version of PHP 7.3. It brings many changes, new functions, and improvements – one of the latter is the increase the speed of script processing compared to previous versions. All news related to PHP 7.3 can be found in “What’s new in PHP 7.3?” and meanwhile, we are going to tests 🙂

In order to compare the latest versions of PHP we made account in package premium-ssd-www (recommended among others for online stores) on normal server where client’s accounts are created – Actually it is server 21 – That is quite important information because the majority of tests we have encountered till now was carried out in „laboratory” conditions in other words on website made special for testing PHP. We, in turn, analyzed the operation of scripts from the point of view of an ordinary user to make the results are more reliable. We tested scripts ten times, then we took out the average of the results

PHP 5.6 PHP 7.0 PHP 7.1 PHP 7.2 PHP 7.3
bench.php 2.680 s 1.038 s 0.749 s 0.499 s 0.385 s
increase of speed compared with previous version 158% 39% 50% 29%
increase of speed compared with PHP 5.6 158% 258% 437% 596%
PHP 5.6 PHP 7.0 PHP 7.1 PHP 7.2 PHP 7.3
micro_bench.php 12.632 s 4.241 s 3.569 s 2.845 s 2.454 s
increase of speed compared with previous version 198% 18% 25% 15%
increase of speed compared with PHP 5.6 198% 253% 344% 415%

The shorter time is better. 🙂

A few words about used scripts:

bench.php

This script mainly performs tasks in loop, except simple functions (which in the loop performs incrementing of the variable value, calculates the length of the string or call an empty function) performs also among others the following tasks:

-calculates the Mandelbrot’s collection

-Ackermann’s function

-calculates the Fibonacci collection

-sorts the pile

-creates a multidimensional array

Source: https://github.com/php/php-src/blob/master/Zend/bench.php

micro_bench.php

This script also relies on loops and performs among others the following tasks:

-calls a function in the loop

-reads the value of the object’s property

-writes the value in object’s property

-checks whether the value is assigned to the object’s property

-checks whether the value of the object’s property is not empty

-invokes the method of object

-reads the value of the static property of the object

-writes the value in the static property of the object

-checks whether a value is assigned to the static property of the object

-checks whether the value of the static property of the object is empty

-invokes the static method of object

Source: https://github.com/php/php-src/blob/master/Zend/micro_bench.php

As you can see the scripts from version to version perform faster.

The above tests have been carried out according to the benchmark PHP Performance Comparison 2018 and 2017 created by Christian Vigh.

We encourage you to perform PHP 7.3 performance tests yourself on SSD hosting

– all you need to do is choose any of the hosting packages, because each of the hosting accounts is in the PHP 7.3 standard.

Smarthost

Leave a Reply