Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105765 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 6975 invoked from network); 20 May 2019 22:29:23 -0000 Received: from unknown (HELO mail-wr1-f66.google.com) (209.85.221.66) by pb1.pair.com with SMTP; 20 May 2019 22:29:23 -0000 Received: by mail-wr1-f66.google.com with SMTP id e15so15922434wrs.4 for ; Mon, 20 May 2019 12:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=NCkPtL681L5I8Xv62PFO4pwbzxx3H8hInuY/QMAXIX8=; b=garUKGBSaFdG63IsOpH6tDiS9TIUawhj6bNyQlb2q4l6RpXp9ASgVOt330XByB8WRu dTwefnrz8c1s0r1VB3aAG/UTanrPO8Ks1hn/pDdJrWPInD7ES07NOYlw/5BI/ToT6Jqs l82uZtBPpmXI6QAJbaOmyLBY+KQx2asPGkbMq1fQ0NCtRFB2oVJD0Vm8zFipx3tI9Dt1 PRgnq6Ed/yfzBSZsPem0j5PqzaEDkhNRFDpodnjeYOzEKHT2TN4OyDXKK4Bk38NHvlbQ srcbw87CpL7DmXafPNTAyIV6NAi9Kfe1O0BqFxVG2xBNZL60zSXDtjL7naqNHmfhh0bM 2Lyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=NCkPtL681L5I8Xv62PFO4pwbzxx3H8hInuY/QMAXIX8=; b=U1uywpOBEzCp85zbEvlN8h6rB3uPWsjV1Dl7WpHG3I+xe1BhO8Aq7CgkCH0iQDP4me +lsv3hBZDfYDzlekH2YBxhuOUZVvC9DFBhlbY9SH7ZLczpjl4T/td+MzoxMn4btZabiq kL6fT54c9N9N0mHmUBkTQ1iFmbQaPITb1K/W7eR+9mFr/5CdOMX4G8Da3BjDsjPsnUas wi3o36g1IBosfl26EJhxJUms6McNxIK4b8Ecje4jnz4ZN8PTuUJICWe/j/v11H7JRZdE z2zVlQcK4noU4Sjf1k3AWUuk1lHJuVoFKcV6BwegSBUE2mLC0ljR1pSkirh9rDFzchEA LyJA== X-Gm-Message-State: APjAAAWXbXsLu6a+z8LUs8uTStuFVYqAsOyrf5KQmv5VTFU+wZtTY3BY T7bBo0X2ob/75keeDb5+fBU= X-Google-Smtp-Source: APXvYqzFSGAQfGRzPBmZz39wAZzaS9gG/36agR40dTk7cGjCQ0KV8I88NQFyj9Ud9guZmz3ox9OVFA== X-Received: by 2002:adf:ecc2:: with SMTP id s2mr42125633wro.258.1558380995978; Mon, 20 May 2019 12:36:35 -0700 (PDT) Received: from ?IPv6:2001:a61:510c:e501:28ae:5fcb:e0ad:b90e? ([2001:a61:510c:e501:28ae:5fcb:e0ad:b90e]) by smtp.gmail.com with ESMTPSA id b5sm16986090wrp.92.2019.05.20.12.36.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 12:36:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) In-Reply-To: Date: Mon, 20 May 2019 21:36:33 +0200 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <16ad66607a0.27c1.08be835b7d1a2c2edb4c4286afe1a236@gmail.com> To: Theodore Brown , Marco Pivetta X-Mailer: Apple Mail (2.3445.104.8) Subject: Re: [PHP-DEV] High performance function autoloading From: gadelat@gmail.com (Gabriel O) On 20. May 2019, at 20:42, Theodore Brown = wrote: >=20 > Can you clarify? I'm not sure what performance improvement trick you > are referring to, or what you mean by "importing all functions". Are > you saying it's a misconception that triggering an autoloader on > unqualified function calls in a namespace will slow down performance? > As I understand it, this is the roadblock for function autoloading. >=20 > Best regards, > Theodore Yes, this is misconception. Namespace resolutions are cached. First = fixer tool bringing support for this was correct: PHP-CS-Fixer auto = imports only optimized functions for this very same reason. > On 20. May 2019, at 20:45, Marco Pivetta wrote: >=20 > Disabling function mocking is good =C2=A9=EF=B8=8F >=20 > It was a terrible practice in first place, and it is usually done for > impure functions that should be wrapped in integration-tested = adapters. =E2=80=A6which dramatically affects design of code. Nobody builds = injectable replacements for these calls. As always, you are speaking = from POV of library maintainer. As a user of your library, you don=E2=80=99= t have perfect design. Nobody has.=20 As a user of the library, I want to have ability to replace every aspect = of it without copying it, while preserving simplicity - this is = impossible to do, because these goals are in opposition.=20 As a contributor of the library, I have found it impossible to write = tests for some parts of very same library, because its code style guide = dictates importing all the functions which makes it impossible to mock = function call. And replacing them with injectable adapters was deemed = overkill (and is subject of BC concerns). Anyways, it doesn=E2=80=99t matter. Disabling function fallback for all = functions has very little benefit like I mentioned.=