Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124743 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 875751A00B7 for ; Sun, 4 Aug 2024 17:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1722794104; bh=BmpLksbkEw2L/+blkXzvZ+84WBBSORI6GNzF6BDNbq0=; h=References:In-Reply-To:From:Date:Subject:To:From; b=DX49DhTEnkaUUDlOnkCLhT2Cv2g0NAjQgvpwgUnWiOpJJG0OZZndPk0FoZuCDlbss 4CwOHkllykB00J+HhDFk+vhemet9icswP4DoldXNWUO9tgcHiUN9GzbVseLRQwAxbl XlGw5WDxMCVN5EOplIezlU2df2mIyNYHobQhLj8brnW+q5x3ka6qaN+O+VDC6to99W H67hlExicdQwlLBFx/gLyTnSTGwrWhdUMXEiB0/Ttj9dGl5+PJF9pqkYjuy5KWsNSB MFr4O7ZhUCajQQeIAz6aG61e7ZK7b56qfihvL2QTwt7s4WulOrP8OTm3NbWuO7OhFp taLAGSADXR8xg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 07D85180069 for ; Sun, 4 Aug 2024 17:55:04 +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-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 ; Sun, 4 Aug 2024 17:55:03 +0000 (UTC) Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-7a1d42da3f7so609256985a.2 for ; Sun, 04 Aug 2024 10:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722794002; x=1723398802; 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=BmpLksbkEw2L/+blkXzvZ+84WBBSORI6GNzF6BDNbq0=; b=OuCHR7vQqnrAu/DQNyTn9hY/rotgzsq9ItT5nECHdQDKlHwrqyT9Lr9tuFk/Sj3S7U fJPbnbhhho1gnLY/wvIBCw5M63l2N8pQgM434gqy4YeruhZF15ucWv7kKaLtcKqhJm5Z ypzzm5KhAHiRAhOkPLsaZQdK73L/WixlaFvhPywUY9ZTw9irRyg2I22ODBGE78z6kXuE DH9JH36GRMWRHUb3q65+Vzhj0/cRV6755nvZ28RMY9PhFJNr5PSpDdco1Se9vqYlwbAE g379ANG3qtynDiJt0swRGtBJWeriLPujtWnagvdgTv8yAEehA63dqe9r24Php4orqKZg TARA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722794002; x=1723398802; 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=BmpLksbkEw2L/+blkXzvZ+84WBBSORI6GNzF6BDNbq0=; b=bMGW9PI/Byk+H1ETVtpgJ1nuBgNyKbWPjcIprUjQVGWnLdcVjG0dzFKvYLpAO8KQAj G2lBwzgFgoSIDKdprKVT8SNbGBONQYcWimUojQy7bNeuu1U2YKSQM7elpcIhKrdAnYkZ 5zlVhI+75F3aNp7rauUIgVQyn4ng4B/VmayRjIp6St8lyQzwTHdxAM41mhjgZZaYhLRM nD47BXlazff0HZreZX0ue18apZRkoigQjGWJHhqFRSyOl8bFgPwCLtOY31TUdtVvXAP6 kt0TYB9d+GCvqJi5TtODilHO0HSyyREY2LE0PjzQs+8jhtdbtU5/NzaRW6AAaHD0325X WqSA== X-Gm-Message-State: AOJu0YwJwx8qs6k1ME+cfGOLTxjya2RpjyrMB/saa1Vhf3IhdM5+UOQm 7ZVEcXr25nnW8xT2npcHvcgjIn7Nlyk93kr6LbZCxdDJ+0xmPZYRU47PM/FlEbnvY4XubrCpLH6 5P45oDb+KCC5Hgxqs6cL2QK+Agdn0Voloka22SA== X-Google-Smtp-Source: AGHT+IGj6qWormvfEAgA6ja2VfgGMGAgL9exNPn/YRLRcFd9N9IIi7farRDlG7hqsNeTLYNt77IXoA7ludOen0iTJoE= X-Received: by 2002:a05:6214:2dc5:b0:6b7:b4b1:85aa with SMTP id 6a1803df08f44-6bb98373a29mr106161256d6.32.1722794002157; Sun, 04 Aug 2024 10:53:22 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <18D4B0E8-F71F-4FCD-87E1-E5E3C4CA5068@gmail.com> In-Reply-To: <18D4B0E8-F71F-4FCD-87E1-E5E3C4CA5068@gmail.com> Date: Sun, 4 Aug 2024 19:53:11 +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) Hi Claude On Fri, Aug 2, 2024 at 9:02=E2=80=AFPM Claude Pache wrote: > > I propose the following alternative approach: > > * establish a restricted whitelist of global functions for which the perf= ormance gain would be noteworthy if there wasn=E2=80=99t any need to look a= t local scope first; > > * for those functions, disallow to define a function of same name in any = namespace, e.g.: https://3v4l.org/RKnZt > > That way, those functions could be optimised, but the current semantics o= f namespace lookup would remain unchanged. That would be an improvement over the status quo. However, if you look at the bullet points in my original email, while some of the optimizations apply only to some functions (CTE, custom opcodes and frameless calls), others apply to all internal, global functions (double-lookup, lookup by offset, specialized argument passing). Hence, we may only get a fraction of the benefits by restricting the optimization to a handful of functions. I also wonder if the impact is actually bigger, as then there's no workaround for redeclaring the function, requiring much bigger refactoring. Ilija