Getting the most out of the PHP 7 engine - the example of Symfony
summary
Symfony v4/v5 applies measured engine-level changes and reports big wins: hello‑world response time falls from ~200ms to ~10ms; splitting the DI container into many files cuts CLI boot from ~130ms to ~15ms; Composer classmap fixes and immutable-string/array usage drop memory by ~11–30%. Uses blackfire for profiling, relies on opcache and a generated preloading script, adds inline require and compiler-pass guards, and shows these changes consistently reduce CPU and memory overhead.
AI-written summary · about
chapters (18)
- 0:00Intro
- 0:15blackfire
- 4:05Synchronous and parallel
- 7:48Persistent memory pools
- 9:09Steps to execute a script
- 9:43First steps are immutable
- 10:03Compile time optimizations
- 11:48Compile time evaluation Works for constants
- 13:07Compile time inlining
- 15:30PHP 7 is slow... at compiling Let's split the container in one file per service
- 18:47Leveraging shared memory
- 19:52Copy-on-write Shared memory is read-only
- 20:41Not triggering copy-on-write
- 23:17Bypassing the autoloader
- 26:47More goodies • Coalesce operator
- 33:15PHP 7.4 - Preloading!
- 38:39Kudos Dmitry and Nikita
- 42:03Conclusion
