Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41482 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9737 invoked from network); 27 Oct 2008 19:52:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2008 19:52:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=phpwnd@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=phpwnd@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.198.238 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: phpwnd@gmail.com X-Host-Fingerprint: 209.85.198.238 rv-out-0506.google.com Received: from [209.85.198.238] ([209.85.198.238:23876] helo=rv-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6F/9A-34199-91C16094 for ; Mon, 27 Oct 2008 14:52:57 -0500 Received: by rv-out-0506.google.com with SMTP id g37so2415448rvb.23 for ; Mon, 27 Oct 2008 12:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=7juQlMNwMJTvofGVOPKRMg8L1R9G+25uWWzfSyRCC80=; b=tYoWp85rQXDiHRQ5mieqxy3gX9iP4fuYD3KYW89jeXmIvwADiGxDjfoJsqC5EBoXHM M3kGUHVh0uFIKwe7qRLtnkjapdEnZjW5bq1aA07JJwrbB1hup72CWQos90ZcsZh2d3kb sqnp2t5lThYOn4P2LrggBOrpG2sZnTMUgQu6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=EtqI4Nk9xiKoeeQ8rniuHoVviMYv5W5R4LwFa2rCz7gJXgZZxtQG+y56mwg6Xserc0 /eIRNefY+RYPh8h8ulc2ZLN/JjIRgE+Od8pi4iQe+rUb/Euzg5f91mA38IGQN5nn00TP Q6FK4jKbZNCcD6VqDeKbnPXy5Zaq8xp4oGy3g= Received: by 10.141.44.13 with SMTP id w13mr3493047rvj.13.1225137174757; Mon, 27 Oct 2008 12:52:54 -0700 (PDT) Received: by 10.141.83.21 with HTTP; Mon, 27 Oct 2008 12:52:54 -0700 (PDT) Message-ID: <11c607a60810271252r4bedeea8q59ce5423891d8e59@mail.gmail.com> Date: Mon, 27 Oct 2008 20:52:54 +0100 To: "Stanislav Malyshev" Cc: "Rodrigo Saboya" , internals@lists.php.net In-Reply-To: <490600CD.5020207@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <49048EC1.9060908@chiaraquartet.net> <4904CE3B.2000001@chiaraquartet.net> <4905EDA9.9050301@zend.com> <11c607a60810271049y419c252q7e21cde9221f1996@mail.gmail.com> <490600CD.5020207@zend.com> Subject: Re: [PHP-DEV] namespace separator and whining From: phpwnd@gmail.com ("Josh Davis") 2008/10/27 Stanislav Malyshev : > 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). So we're talking about an __autoload() that uses relative paths right? > That's how 100% of existing code is written, btw, and how 100% of existing > programmers are educated. I'm not sure I understand your argument. First of all, as you pointed out there is virtually no code out there using namespace so we can only speculate about how programmers will be educated on namespaces. Then, if we assume that most people will use the global namespace without prefixing it, what would be the best resolution order for them? (you didn't mention it in your previous message) > How they are supposed to know that? People who care about performance are supposed to profile their code... I guess? If they don't, they probably don't really care about it. People who care about performance are supposed to be knowledgeable about good practices. > 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. Include + relative path does not give any indication either and it does exactly what you've described above (traverse the full include path). Neither does in_array() or the thousand other slow things we can do with PHP. As I said I only expect people who care about performance to study that kind of things. Wouldn't it be more beneficial to the users to educate them on the performance implications of using relative paths in __autoload() rather than base the scope resolution on worst-case scenari? > What's "average application"? There are no namespaced applications now. I'm thinking about taking any of Wordpress, phpBB, Drupal, etc... and making them run in a namespace. Well, it would only work for those that use __autoload(). With relative paths. Come to think of it, why would an application autoload files that aren't in its directory? That's what perplexes me the most about your position, I can't think of real-life examples where the performance impact would be as bad as you describe it. -JD