Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94956 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36777 invoked from network); 8 Aug 2016 21:54:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Aug 2016 21:54:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.175 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.175 mail-pf0-f175.google.com Received: from [209.85.192.175] ([209.85.192.175:36762] helo=mail-pf0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/FA-33134-5AFF8A75 for ; Mon, 08 Aug 2016 17:54:46 -0400 Received: by mail-pf0-f175.google.com with SMTP id h186so122681608pfg.3 for ; Mon, 08 Aug 2016 14:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=0PG3hLdzer6sgDFBI1m6SjYExewSEOhduFxpP8GF/KE=; b=p0pCG323z3Ll1cJ2VOQfiD0OKH0wfoBV0duPVxHQzp2QpqGhGAfxaBDE9JgogPd05D TO2kYhFITm95rFMa0j42qPwMLA1A9JIW/BJm3wPfWLw7bWgpS4CgqkV+UxVgThrPMXk7 EiF4MCRPdRqfz9vjjusWtVlewLDxe/i1J+qcb/zqQ/e2d2N9xvc15rnxGpXTiQrHz76h kM9gLqfI0xpo+YZJ1yaXhZEqaZ7B3B0L1Xy5sD6GNZFopf76U7UmwqhWZyKimPk2+eeL LBQkuDmmndsJagipNozsCA1coKwqM5UhD4kJ5VLyIQHuFWoOKPsfJ7sMb1zZ5l1xyL+N Cn/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=0PG3hLdzer6sgDFBI1m6SjYExewSEOhduFxpP8GF/KE=; b=XIcvGCCCdOF1FBouJMdJXa4iX6FZM9DD74qf6tFk7+4pX/spxuIrarpdo2sODQpcio iqg6wE/W5IyTD3XmhSbFn1LdhJKXPYdaDob8Zx9hQ/9WYyBmpZskDGGEboFC7/JH+4+L i1QBhSyQwS1D43CAXBg6FCVY1Q2eBIKrSvWPJlwIIQMel2MiTu6obUv7Kdb4OYsu2KwA CbsrIi7GwiUOf4FHaVq0DwP5GuwSuLRpy98IirvTFjWWAjdNLJOk1LOmxeN3VeQEb9XL yId+PIGQTjc7EBS4TcFecwzmigAiBFB+07J0X71ooviCcrbkeUXeLYm9Aw1nD1Faf+tp 3evQ== X-Gm-Message-State: AEkooutt6kljv7n7wTGsvEpg4sMjVe5eCmKOiclRpqJFONIbfqJ3hwmEcZCSy3aKwl8qQw== X-Received: by 10.98.131.8 with SMTP id h8mr165853721pfe.124.1470693282910; Mon, 08 Aug 2016 14:54:42 -0700 (PDT) Received: from Stas-Air.local (76-220-46-95.lightspeed.sntcca.sbcglobal.net. [76.220.46.95]) by smtp.gmail.com with ESMTPSA id ah5sm50483601pad.30.2016.08.08.14.54.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Aug 2016 14:54:41 -0700 (PDT) To: Rasmus Schultz , Nikita Popov References: Cc: PHP internals Message-ID: Date: Mon, 8 Aug 2016 14:54:40 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Function auto-loading From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Of course calling e.g. strpos() should not trigger the auto-loader > repeatedly - can we cache the information that the auto-loader was > attempted once during the current script execution? so that e.g. only the > first call to strpos() triggers the auto-loader? I think triggering it even once for *every* internal function in the code may be too much. > I suppose it would still happen once for every namespace from which > strpos() gets called, so maybe this optimization doesn't help much. Exactly. Also, caching stuff assumes static environment. What if it changes, e.g. autoloader gets different configuration? -- Stas Malyshev smalyshev@gmail.com