Olemme lisänneet PHP 7.2 tuen kaikkiin webbihotelleihimme tänään klo 18. Päivityksestä ei aiheutunut katkosta.
PHP 7.2 on viimeisin versio suositusta ohjelmointikielestä. Voit vaihtaa PHP version hallintapaneelistasi.
Suosittelemme käyttämään aina viimeisintä tuettua versiota PHP:stä, jotta voimme taata sivustollenne korkeimman mahdollisen suorituskyvyn.
Lisätietoja ja apua päivittämiseen saat tarvittaessa tuesta avaamalla tukipyynnön täältä.
PHP 7.2.0 Release Announcement
The PHP development team announces the immediate availability of PHP 7.2.0. This release marks the second feature update to the PHP 7 series.
PHP 7.2.0 comes with numerous improvements and new features such as
- Convert numeric keys in object/array casts
- Counting of non-countable objects
- Object typehint
- HashContext as Object
- Argon2 in password hash
- Improve TLS constants to sane values
- Mcrypt extension removed
- New sodium extension
The migration guide is available in the PHP Manual. Please consult it for the detailed list of new features and backward incompatible changes.
PHP 7.1 vs 7.2 Benchmarks (with Docker and Symfony Flex)
Like PHP 7.1 before it PHP 7.2 is not promising any significant performance improvements. But it does come with some improvements like Argon2 password hashing and is a drop-in upgrade for most contemporary PHP projects. With containers becoming the norm, switching versions in hosting is a simple operation.
The benchmarked application is the Symfony Flex port of the hybrid application I did back in January. The project now has the required configuration to run it with Docker, and you can find the full source on GitHub. The Docker setup is based on the Symfony Flex example from Kevin Dunglas, which I found a pleasure to work with.
The benchmarks were ran on a Virtual Private Server (VPS) on UpCloud (try free trial for high performance VPS) with a1 CPU and 1GB of RAM. For PHP the setup using the official PHP-FPM images of PHP 7.2 RC4 and PHP 7.1. The database in use is SQLite, with the API controller having some simple TTL caching to verify the DB we're not benchmarking the database.
Benchmarks were ran three times and the average results are displayed. In addition to the standard PHP 7.2 configuration, I also tested with enabling Dead Code Elimination (DCE) optimisations which will be further developed in PHP 7.3.
Results and conclusions
Using the front page controller with Twig rendering there is some differences with PHP 7.1 and 7.2, which result to some percentage points of difference. DCE, it seems like it further boosts performance - making the difference between PHP 7.1 and 7.2 significant at higher concurrencies. Maybe a result of the OPCache improvements?
When calling the API backend controller without any Twig rendering tasks, the differences between 7.1, 7.2 and 7.2-DCE are quite significant. It seems like the optimisations come into play at 50 & 100 concurrency where 7.1 stalls, but 7.2 remains constant.
As always, take any benchmark results should be taken with a grain of salt, but PHP 7.2 does seem to deliver a sizeable boost at least with Symfony Flex (with 3.3 components) when running at high concurrencies. There is no PHP 5.7 vs. 7.0 type leap, but as said this was expected. In the meanwhile the team continues to work on 7.3 with further DCE improvements and the JIT engine that has been in the works for some time now.
It is worth noting that there was a memory leak in PHP 7.2 (RC4) when running benchmarks, so you might want to set PHP-FPM setting pm.max_requests to something else than the default value 0 to avoid swapping in long running environments. Notably this only happened with running the rendered page, but not the API endpoint.
More PHP performance articles on this sit: MoreMore
- PHP 7.1 vs. 7.0 performance benchmarks with Symfony
- Symfony Benchmarks: PHP 5.6, HHVM 3.11 and PHP 7.0.1
- Symfony Benchmarks: Scaling PHP by adding CPU & RAM
- Symfony Benchmarks: Symfony Proxy vs. Varnish
- Symfony Benchmarks: PHP-FPM vs. PHP-PM (on PHP 7 and HHVM)
PHP 7.2 Benchmarks, Performance Of PHP 5.3 To PHP 7.2 On AMD EPYC
With PHP 7.2 due for release before month's end and the final release candidate (RC6) already available that in essence is very close to the final build, here are some fresh benchmarks from PHP 5.3 through PHP 7.2 RC6 while using an AMD EPYC Tyan server.
Back during PHP 7.2's beta stage I ran some PHP benchmarks and found the performance of this PHP update improving, albeit not as significant as the change from PHP 5 to PHP 7. Now with having PHP 7.2-RC6 that should be almost identical to v7.2.0, I carried out some more benchmarks over the weekend.
Tests this time were done on a Tyan 2U server with AMD EPYC 7601 processor and running Ubuntu 17.10 with the Linux 4.13 kernel.
The long-standing PHPBench is about 15~16% faster with PHP 7.2 over PHP 7.1. Or for fun if comparing it back to the PHP 5.3 days, it's 3.3x the speed of that once common PHP version.
Next up is our own Phoronix Test Suite self-test from the PHP command-line. With the Phoronix Test Suite self-test it's mostly doing a lot of XML parsing, generating of SVG graphs with the PHP DOM, and other routine processes done by the Phoronix Test Suite itself.
With PHP 7.2 is a small improvement in performance going from 7.1 stable to 7.2 RC2. This is a bigger improvement than we saw going from 7.0 to 7.1, but obviously not the huge gains seen from PHP 5 to PHP 7.
The render sub-test of specifically doing a lot of SVG graph generation with the PHP DOM shaved some time off with PHP 7.2.
The process of merging multiple (XML-based) result files together was about the same with PHP 7.2.
The peak memory use was about the same.
Overall these PHP performance numbers are looking promising with PHP 7.2 being another routine update to PHP7 and it bringing some performance benefits on top of the new libsodium extension for crypto and other improvements to the PHP programming language.
maanantai, tammikuu 15, 2018