Hi Marco,

Thank you, that’s very clear and actionable.

I’ll focus the benchmarks on cold-start and warm-process scenarios as you 
outlined, and compare autowiring overhead directly against manual instantiation 
across the relevant cases.

I’ll follow up once I have data to share.

Best regards,

Zoli





eng. ANDRÁS Zoltán-Gyárfás
---------------------------------------
tel: +40 745 797 798
mail: [email protected]

> On 30 Dec 2025, at 20:41, Marco Pivetta <[email protected]> wrote:
> 
> Hey Zoli,
> 
> On Tue, 30 Dec 2025 at 08:17, ANDRÁS Zoltán Gyárfás <[email protected] 
> <mailto:[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