2. PHP 7 new internals
Full 64bit support
New Thread Safety mechanism
New engine memory management
New optimized executor
New optimized structures
3. PHP 7 full 64bit engine
PHP was known to be platform dependent on this crucial
criteria
LP64: Linux64 (and most Unixes)
LLP64: Windows64
ILP64: SPARC64
http://www.unix.org/whitepapers/64bit.html
string size signed integer
Platform int long
LP64 32 64
LLP64 32 32
ILP64 64 64
4. PHP 7 full 64bit engine
PHP 7 now uses platform independant sizes
Strings > 2^31
Real 64bit userland PHP integers
LFS (Large File Support)
64bits hash keys
Whatever your platform (OS) : consistency
5. PHP 7 new memory management
PHP 7 has reworked every memory management
routine
Use less heap and more stack
Zvals are stack allocated
refcount management more accurate
Scalar types are no longer refcounted
Redevelop a new MM heap, more optimized
Based on sized pools (small, medium and large)
CPU cache friendly
Concepts borrowed from tcmalloc
6. PHP 7 thread safety
PHP7 has reworked its thread safety mechanism
routine
PHP 5 thread safety routine had a ~20% perf impact
This is no more the case in PHP 7
Still some more work to do, but lighter
TLS is now mature, and it is used
For PHP under Windows (mandatory)
For PHP under Unix, if asked for (usually not)
7. PHP 7 new structures
Critical structures have been reworked
More memory friendly
More CPU friendly (data alignment, cache friendly)
Strings are now refcounted
Objects now share their refcount with other types
Wasn't the case in PHP5
The engine Executor uses a full new stack frame to
push and manage arguments
Function calls have been heavilly reworked
9. PHP 7 performances
A lot of tweaks have been performed against PHP 7
code performances.
A lot of internal changes - invisible to userland - have
been performed to have a more performant language
CPU cache misses have been heavilly worked on
Spacial locality of code is improved
This results in a language beeing at least twice fast
and that consumes at least twice less memory
13. PHP 7 performances
Take care of synthetic benchmarks
They only demonstrates basic use cases
Run your own benchmarks
Run your own applications against PHP 7
On a big average, you can expect dividing CPU
time and memory consumption by a factor of 2
compared to PHP-5.6, probably even more than
2