
What compiled DI containers actually buy you
Container compilation moves reflection from request time to build time. What that removes, what it costs, and when it matters.
15 posts
Posts and notes.

Container compilation moves reflection from request time to build time. What that removes, what it costs, and when it matters.

One structure serves as list, dictionary and set. Packed and hashed layouts, what each costs in memory, and when a conversion happens.

OPcache removes compilation, not execution. The JIT reaches arithmetic-heavy code and little else. Where the remaining time lives.

Microbenchmarks measure exactly what you tell them to, which is rarely what you meant. Method, noise, and the numbers worth reporting.

A request walks from the SAPI to the Zend VM — lexing, compilation to opcodes, the OPcache lookup that skips both, and execution.