Dmitry Stogov shared on PHP internals his work on Inheritance cache, a proof of concept that eliminates overhead of PHP class inheritance. Dmitry explained that PHP classes are compiled and cached (by opcahce) separately, however their “linking” was done at run-time – on each request.
The process of “linking” may involve a number of compatibility checks and borrowing methods/properties/constants form parent and traits. This takes significant time, but the result is the same on each request.
The patch shows 8% improvement on Symphony “Hello World” app. The new improvement should impact more heavy OOP apps such as Symfony or Laravel. For WordPress there is only 0.5% improvement according to callgrind.
Inheritance Cache performs “linking” for unique set of all the depending classes (parent, interfaces, traits, property types, method types involved into compatibility checks) once and stores result in opcache shared memory.
You are invited to review and give your opinion, Great work Dmitry ! Find out more at https://externals.io/message/113091