Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41473 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82081 invoked from network); 27 Oct 2008 17:56:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2008 17:56:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:57954] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/85-34199-3B006094 for ; Mon, 27 Oct 2008 12:56:04 -0500 Received: from us-gw1.zend.com ([192.168.16.5]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 27 Oct 2008 19:56:32 +0200 Received: from [192.168.16.110] ([192.168.16.110]) by us-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 27 Oct 2008 10:56:29 -0700 Message-ID: <490600CD.5020207@zend.com> Date: Mon, 27 Oct 2008 10:56:29 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Josh Davis CC: Rodrigo Saboya , internals@lists.php.net References: <49048EC1.9060908@chiaraquartet.net> <4904CE3B.2000001@chiaraquartet.net> <4905EDA9.9050301@zend.com> <11c607a60810271049y419c252q7e21cde9221f1996@mail.gmail.com> In-Reply-To: <11c607a60810271049y419c252q7e21cde9221f1996@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 27 Oct 2008 17:56:29.0538 (UTC) FILETIME=[56C11C20:01C9385D] Subject: Re: [PHP-DEV] namespace separator and whining From: stas@zend.com (Stanislav Malyshev) Hi! > - you use an internal class many, many times (as the overhead from a > handful of invocations would be negligible) Actually, one time is enough, as it can bring an application from essentially zero disk accesses (with bytecode caching) to multiple disk accesses (to traverse full include path to exhaust all autoloading capabilities). > - you do implement __autoload(), that __autoload() accesses the > filesystem and the result is not cached (isn't there a stat cache?) or There's no negative autoloading cache. > - you didn't reference the class using the global namespace (IOW, "new > PDO" instead of "new \PDO") That's how 100% of existing code is written, btw, and how 100% of existing programmers are educated. > I'd expect people who execute that kind of code and care about > performance to know that referencing internal classes in the correct > namespace is more efficient. People who don't know the difference are How they are supposed to know that? It doesn't give any error, it doesn't give any indication anything is wrong. It's just slow. Expecting all people to scrupulously study every note in the manual is over-optimistic at best. > Perhaps the performance argument would have more weight if somebody > benchmarked the impact on an average application? What's "average application"? There are no namespaced applications now. But you can estimate it if you take big application, run it under bytecode cache and on each use of internal class you insert, say, 5 disk accesses. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com