Hey Zoli,

On Tue, 30 Dec 2025 at 08:17, ANDRÁS Zoltán Gyárfás <[email protected]>
wrote:

> If you have any guidance on what you would consider a representative
> benchmark or a meaningful performance threshold for “worth moving into
> core”, I’d appreciate it.
>

In the grand majority of cases where autowiring is meaningful (at least for
PHP), you care about a "cold start" of the application (although that's
changing with ReactPHP/FrankenPHP/Roadrunner/etc.).

You may design a PHPBench or Hyperfine test that:

* starts a PHP process, autowires something, shuts down. Hyperfine helps a
lot here.
* repeats the above, but within a warm process (classes already loaded,
tight loop repeating the operation). PHPBench is a bit more precise here.

You probably care about these cases:

* zero-arguments constructor
* simple concrete class references
* default constructor arguments
* resolvers
* autowiring of a complex multi-level structure

In all the above cases, you probably care about the usage with autowiring
API vs the usage via direct instantiation, so you can see the exact
overhead.

Marco Pivetta

https://mastodon.social/@ocramius

https://ocramius.github.io/

Reply via email to