Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.87 KB

File metadata and controls

37 lines (24 loc) · 1.87 KB

Performance

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.

Learning Objectives

  • Cache compiled bytecode and application data correctly.
  • Profile an application to locate genuine bottlenecks.
  • Reduce memory usage with streaming and the right data structures.

Caching

  • Opcache — bytecode caching and preloading.
  • APCu — in-memory user-data caching.
  • Redis-Caching — shared cache and session store.

Profiling

Memory

Labs & Exercises

  • 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_consumption for a real codebase and demonstrate cache thrashing when it is set too low.

Related