Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129725 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 9129C1A00BC for ; Tue, 30 Dec 2025 18:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1767120104; bh=ea9gxih81t4wnkKpCCNGmcrgtRmCA8wD+FHjg3atNzE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=EzLJc/Dnchh3XILyQFj4O7YcOxyi1HMFxfaH6oX5Nmp4A1z7oHflAXbX2QHAhAjwG SIMveJNrqKsW/9jNjNjHVloe8VFiaFO0TLDtptetnjobnz6OqjlH+o/qyjV4LsxdiZ vtOScVesCg4r4XVec3Fbz6uNdpHv6i+jsmJpl6q+cYndDmZBlOpfkMrWk+0y+omMnw p7DM5puarjZWSSxu19Dah25ByvJ0XNOsHUz8dDVNj/e+O6J6F1SNVr2AjldGT97tKq 4QrZBRpl0a9NsekiqIjFR0gJXKcuNIvvygYsnEkI1sMl3ZHkK+S+ZfiJCLiGIHzoZk VVVOJlIRatrHQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4545C1801E7 for ; Tue, 30 Dec 2025 18:41:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 30 Dec 2025 18:41:42 +0000 (UTC) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-803474aaa8bso3654874b3a.0 for ; Tue, 30 Dec 2025 10:41:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767120097; x=1767724897; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ea9gxih81t4wnkKpCCNGmcrgtRmCA8wD+FHjg3atNzE=; b=AX6xEA31qojHs4N5B3Xl0hv6P9MRqDdU+rKkeVoBE1YgCK0bL79FUzk8D5yrRXOtL0 Cvxq3nBGfrOqky1nJpkFYP8DBNOFch1b1FIio4UNLaYlaDGp49dtwK04S6TnlGoFVV4k IrZE/rWd8mAO8e62erv2lXKFPSU63IiNlezKVUiJidNdPphU80tcy0+jlo7tqMTAOmpt 7MtwPwEZaRTKUiN2uK7QVm7XHPqwzagcR6a0BeXShKhjoPv2BQ+c+QrdjMxeIQhMiPK6 fq7rK7j7+0LcgBNu3j5HlFVrOrCqIX3xVC8rjnr37Y7l3Pu4HD+yC/flpivC3DZzJ2Vm IjaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767120097; x=1767724897; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ea9gxih81t4wnkKpCCNGmcrgtRmCA8wD+FHjg3atNzE=; b=v6DWkGKERwPP8yKk2VqH5+GKrSJH2jMO1Gcf0+r0c8rAMnbnt3TQiwXgHEwlhfHOI6 OsSSbwLbh9owOpbbt5QWSpnihU00hlLUaGBprj6kfBUqa4KRCwnDgT84d9jIjOXe1IuX xKKP1bWpSFYFPX3u57LPt+fF/Mx9S+7bbkym/ZlQ4ASetKYMXYaBhcCNIccrDVC2EAMy CUEgREoj/+f4XwSbjYMA6BcuXrYgvLuHw6NnrQIBgrraT90W8gTcavmZk2Bntdj+Tu4w rdvQ0xRGeE2F0X3zd6FlRmymKP5LIx4Rx5dYP1M4I7+aBbFgmGtwGbKxWeDHyQsK4xKY eQYA== X-Gm-Message-State: AOJu0YwUeSjurNHpIGMXMXQXsL8cuxc/zsas7S1emAJaaByZZ5us371x EEOsNDDmuzkBO6LSw4kHYMe7i4rc7apfO8dF2ym7ZRja/SnrZ4wbzzL9DZx57ep1Rh3h/8uWfPc DraNn4dVaffKdUZRGbloWnE1IC38zreQ= X-Gm-Gg: AY/fxX5nOjD9HZLD3MwDd6aj9JGd5ANQztSCJwWhjPZcIeMP/84vKxt3rZ6cV+KvGAm lZgCoieBzhCSyGyN/upy7JwyWnaxD30YqWNMzL1IpU2pW/aWRm3L04aMKkuFnMXZwntmblCr9Y/ l32SWua+75vW0/3Zd4mLP6dYHlPmmy5eFYjEdD7YIa6qEdooA5ATX4l0G6coJwqPs4gAaPrtREY setup0ITVQ9NKWKCkYkkQnjCLUXpFVsJr3W1euTrLYmTMREIA9NUbjHyZJGY5cjXa0jPMa1hiUd 4Shv4VtX1nf90DI7xgWVS2OQGBNwPJZdWEiEXEAEW7/mawjEW3LldADAb4mksLxlnMCbna0qDdJ MwG9oCy5rus9fmA== X-Google-Smtp-Source: AGHT+IH+Nfna3vZQ44ZxT8h+xuJSsuPZ4U9MhwaLgj6a5EuFUvbprag+2DvKmGZXfPkzokwxPrhT1a+jpBjFjXNaQ9c= X-Received: by 2002:a05:6a20:549d:b0:35f:84c7:4012 with SMTP id adf61e73a8af0-3769f92fca1mr31622910637.29.1767120096698; Tue, 30 Dec 2025 10:41:36 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <6C2A8D96-BB4C-4091-85D8-21654C242364@gmail.com> In-Reply-To: <6C2A8D96-BB4C-4091-85D8-21654C242364@gmail.com> Date: Tue, 30 Dec 2025 19:41:24 +0100 X-Gm-Features: AQt7F2p6Vyrgsu7hnxF2RJnePsWyigSX9F8YW8_EYyZ7-BYlmlv9ZuBUz4O6Im8 Message-ID: Subject: Re: [PHP-DEV] [Discussion] Reflection-based constructor autowiring (scope clarification) To: =?UTF-8?B?QU5EUsOBUyBab2x0w6FuIEd5w6FyZsOhcw==?= Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="000000000000a3a74906472fb52f" From: ocramius@gmail.com (Marco Pivetta) --000000000000a3a74906472fb52f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Zoli, On Tue, 30 Dec 2025 at 08:17, ANDR=C3=81S Zolt=C3=A1n Gy=C3=A1rf=C3=A1s wrote: > If you have any guidance on what you would consider a representative > benchmark or a meaningful performance threshold for =E2=80=9Cworth moving= into > core=E2=80=9D, I=E2=80=99d 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/ --000000000000a3a74906472fb52f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey Zoli,

On Tue, 30 Dec 2025 at 08:17, ANDR=C3=81S Zolt=C3=A1n Gy=C3=A1rf=C3=A1s &= lt;azolee@gmail.com> wrote:
<= /div>

If you have = any guidance on what you would consider a representative benchmark or a mea= ningful performance threshold for =E2=80=9Cworth moving into core=E2=80=9D,= I=E2=80=99d appreciate it.


In th= e 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 t= hese cases:

* zero-arguments constructor
* simple concrete class references
* default constructor argumen= ts
* resolvers
* autowiring of a complex multi-level st= ructure

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.

= =C2=A0
--000000000000a3a74906472fb52f--