Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125157 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 qa.php.net (Postfix) with ESMTPS id 0132B1A00BD for ; Fri, 23 Aug 2024 18:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724437147; bh=MkLSM6IUZK7VOn/UzA/bIyAfoRH+mBltfBEEXjEngDU=; h=References:In-Reply-To:From:Date:Subject:To:From; b=h+6wRTKTk9E3oOXbnSpmL549n/WYbgcpFThZSttCSPvbKyPSkX3/wGw1aB2+NL/oj jMIrXouMYEomXWdYhQYfKQ0AlijneeEgGalptbrKdvR4Kfptf4N+wwrDQ7FlAYiJac uRPMghuEZYY0AVB1z+d373AcTL0j76AdwNdmF8hAA0PmAOawg73bVUoUjklPse8BDj DqYoz9Sp5xYTAOMtMrH9D0K+S7y1XzZDjBghS2U7pLSG+oDD0Pc8WHIH0wJzBMS+Jw kytggPSV9TMEhPhBAKZS68B+jhqi8fTXFCHwWYO+JdJpYDveXqiFKkhKQo/n1+B7t+ hvS+2BQaCMtpQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 37B3918006F for ; Fri, 23 Aug 2024 18:19:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) 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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (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 ; Fri, 23 Aug 2024 18:19:06 +0000 (UTC) Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-6bf66fe9d8bso10059226d6.0 for ; Fri, 23 Aug 2024 11:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724437035; x=1725041835; darn=lists.php.net; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MkLSM6IUZK7VOn/UzA/bIyAfoRH+mBltfBEEXjEngDU=; b=mmUjLoIWYv7LiMyDXEYuokuvutryn/GRNT+Ayu0/euPsYDUNx8V1jDIWQ3KMjMlNfa 6skgmTDvhFenM2P1xE0M+LJttdwhyTA8zTOKl/+IXcu9XIJ4e94+GYghDPQT5dTEOslp vM8jzhDubQ38PpZpD24AHHu53qhsKtF69pEpP/dcZYjcBZ2Lqw6Oms5rDLKBQSNBssR8 yARo4WMveQnhZ0rHW6GuEbxJJvQH45mZiVf45ZoUyw46A6xsIBqbfHr48Db5Af4lnD+S CHGg+gRZFaPMRgmzGuDrtmf6vsOCJasMjJmVM3zHPhN6+Zn01jLuXXCUmYP1N28369P5 B4cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724437035; x=1725041835; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MkLSM6IUZK7VOn/UzA/bIyAfoRH+mBltfBEEXjEngDU=; b=Me/xup0xygYSpivA4oUSZqwat1g7Degu+j3KQyRP1uNrbrQC0MfTyJdXMYLZG678u/ JH1ysl1S5Zw4HQRT60vOcjeTi7cU7AtWwouFDH9nLEWs7yHrEysYuHLp3GAoYe3kXZ2C 1LgeHi0PrxVVq8Xfhi+Z+Vxq9+WpvviIaZAnDGJNJQcOhfc7F701omCu7BvNrsk07EMb 48qte9O1AsEmFV1m/cymedMMzUJxvWdjzarlX8bx1s8iYaYI7dnp5tDqvCBQzORfdhgo idxyshbTWsVGEaLrtUpveRPED0pykLThmQK3DtCeTponSo/GC8LecM8VNLf06gFQ08Yt 7RyQ== X-Gm-Message-State: AOJu0Yy4wzJrYmmmPZO50sZ/PQuTrco2GLIdInutp+Fy696f6FUgBuXu XiEqlHzU61sV8YYy6Yh9JQtLAgX+6IseDVFdynm7+4TyRedfi9G30F1rDZ+xIiCsavcca1Qg2zR Owe0vYf7pHC7L+dM9gKVZ1/SeVA1LZH/921k5gg== X-Google-Smtp-Source: AGHT+IFhzayq2xgBOTkpoGLsz5huJobdsgNJFnPP341/iAKzGhtCBcFc+XciSEsrPrAmggu6RDo86Ean4MU/GZKUh90= X-Received: by 2002:a05:6214:846:b0:6c1:6e39:7e11 with SMTP id 6a1803df08f44-6c16e3984f0mr27405646d6.10.1724437034566; Fri, 23 Aug 2024 11:17:14 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <21D6F160-5EAE-44FA-907B-E1DAAC1B8D75@rwec.co.uk> <53BD062A-4D7F-4E5D-852E-6D27641213A8@koalephant.com> <7607FD64-5572-466E-9866-63C2536B2A09@koalephant.com> <0d269a38-28fe-494c-a903-50022e09f27b@app.fastmail.com> <63DAE337-B117-4380-8735-186DC30FE0B7@rwec.co.uk> In-Reply-To: Date: Fri, 23 Aug 2024 20:17:03 +0200 Message-ID: Subject: Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local) To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tovilo.ilija@gmail.com (Ilija Tovilo) On Fri, Aug 23, 2024 at 8:11=E2=80=AFPM Stephen Reay wrote: > > On 24 Aug 2024, at 00:32, Ilija Tovilo wrote: > > > I obviously also disagree with 3. as I wouldn't have sent this > > proposal otherwise. :) Performance improvements are hard to come by > > nowadays. It was measured on real codebases (Symfony and Laravel). > > Just to make sure I'm not misunderstanding something here - Symphony and = Laravel (or anyone else) can get the exact same performance benefit you're = talking about, if they use either a leafing `\` or `use function...` in the= ir own code, today, correct? As I wrote in my e-mail: > For some context: Before proposing this change, I asked Symfony if > they were interested in disambiguating calls to improve performance, > given I did some work to make fully qualified calls faster. But they > were not, stating that the change would be too verbose for their > liking. > > Making unqualified calls to mean local would force Symfony into making > the change, which is not the approach I'm interested in taking. Yes, the full performance benefits can be achieved by prefixing your entire codebase, which includes not only your own code but also the code of your framework. How much you benefit from just converting your own code of course depends on how much you rely on vendor code. > I'm not going to pretend to know how many files either project has that u= ses global functions, but neither of those two existing options seems parti= cularly "hard to come by" in my mind. The "hard to come by" part is referring to the engine, which is quite optimized for the current semantics. Some of PHPs quirky semantics make it hard to improve it further, this being one of them.