Making PHP applications fast: bytecode and data caching, profiling to find real hotspots, and reducing memory footprint — measured, not guessed. Map-of-Content for the Performance module of Secure PHP Development.
- Cache compiled bytecode and application data correctly.
- Profile an application to locate genuine bottlenecks.
- Reduce memory usage with streaming and the right data structures.
- Opcache — bytecode caching and preloading.
- APCu — in-memory user-data caching.
- Redis-Caching — shared cache and session store.
- Application-Profiling — how and why to profile.
- Blackfire — profiling and regression testing.
- Xdebug-Profiling — cachegrind profiles with Xdebug.
- Memory-Optimization — generators, streaming,
unset, WeakMap.
- Lab-Profiling-and-Opcache-Tuning — measure a slow endpoint, then enable Opcache, kill an N+1 query, and add APCu — attributing each win with a percentile benchmark harness.
- Module challenge: profile one Mini-Project under Xdebug, find its single worst function by inclusive cost, fix it, and prove the improvement with median + p95 timings (not a single sample).
- Practice: size
opcache.memory_consumptionfor a real codebase and demonstrate cache thrashing when it is set too low.
- Configuring-php.ini — the runtime settings behind OPcache and limits.
- Generators — lazy iteration for memory efficiency.
- Deployment — where these settings are applied in production.