PHP 7 Opcache adds Huge Pages support for extra performance
The PHP 7 opcache (open sourced by Zend, which replaced APC) gets a little performance boost from the added support of Huge Pages by Dmitry Stogov:
Added an experimental ability to move PHP code pages (PHP TEXT segment) into
; Enables or disables copying of PHP code (text segment) into HUGE PAGES. ; This should improve performance, but requires appropriate OS configuration. ;opcache.huge_code_pages=1
Note that PHP must first be compiled with the appropriate configure option:
./configure --enable-huge-code-pages (... etc.)
Essentially, Huge Pages (on OS that support them) reduces the size of the index that has to be searched to find allocated memory by allowing larger chunks of memory to be claimed instead of smaller blocks.
See the Debian wiki for a better explanation of huge pages:
This will have to benchmarked to prove if it really enhanced performance and by how much (I suspect low single digits but everything helps).
Also new to PHP 7 will be a file-based cache for the opcache which can be used as either the primary or a secondary cache level:
Added second level file based opcode cache. It may be enabled by setting opcache.file_cache=<DIR> configuration directive in php.ini The second level cache may improve performance when SHM is full, at server restart or SHM reset. In addition, it's possibe to use file cache without SHM at all, using opcache.file_cache_only=1 (this may be useful for sharing hosting), and disable file cache consistency check, to speedup loading at the cost of safety, using opcache.file_cache_consistency_checks=0.
; Enables and sets the second level cache directory. ; It should improve performance when SHM memory is full, at server restart or ; SHM reset. The default "" disables file based caching. ;opcache.file_cache= ; Enables or disables opcode caching in shared memory. ;opcache.file_cache_only=0 ; Enables or disables checksum validation when script loaded from file cache. ;opcache.file_cache_consistency_checks=1