Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9528 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97345 invoked by uid 1010); 24 Apr 2004 07:13:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 97073 invoked from network); 24 Apr 2004 07:13:19 -0000 Received: from unknown (HELO xaxa.search.ch) (195.141.85.117) by pb1.pair.com with SMTP; 24 Apr 2004 07:13:19 -0000 Received: from localhost (localhost [127.0.0.1]) by xaxa.search.ch (Postfix) with ESMTP id 3A1CC6CFC2; Sat, 24 Apr 2004 09:13:19 +0200 (CEST) Received: by xaxa.search.ch (Postfix, from userid 65534) id 1B7A46DB5A; Sat, 24 Apr 2004 09:13:18 +0200 (CEST) Received: from cschneid.com (ultrafilter-i [192.168.85.2]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by xaxa.search.ch (Postfix) with ESMTP id 6ECB16CFBF; Sat, 24 Apr 2004 09:13:17 +0200 (CEST) Message-ID: <408A138C.2010801@cschneid.com> Date: Sat, 24 Apr 2004 09:13:16 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114 X-Accept-Language: en-us, en, de-ch, de MIME-Version: 1.0 To: Rasmus Lerdorf Cc: internals@lists.php.net References: <4089E106.4040409@akbkhome.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on xaxa.search.ch X-Spam-Level: X-Spam-Status: No, hits=-1.5 required=5.0 tests=BAYES_01 autolearn=ham version=2.63 X-Virus-Scanned: by AMaViS 0.3.12pre8 Subject: Re: [PHP-DEV] Performance Consideration of 1 class per file From: cschneid@cschneid.com (Christian Schneider) Rasmus Lerdorf wrote: > 1. The included_files list gets updated each time you include a file. In > order to make sure that the same file included by different paths or > symlinks don't conflict we do a realpath() on the file to be included. That's done by PHP, not APC, right? Does this only apply to require_once or require as well? > 2. APC uses the file's device and inode as the lookup key into shared > memory to find the opcodes for the file, so a stat has to be done on Hmm.. If the stat on the file and the check for device/inode would be done first then you wouldn't have to do a realpath, right? But I guess that's not easily done until after the realpath check. > So yes, jumping from 20 to 30 include files could very well bring a rather > significant performance hit. I guess that's only important if your PHP code is really simple and you don't do something like e.g. DB queries because otherwise that'd be 90% of the running time anyway, right? I guess someone _that_ considered about performance could easily do a cat *.php | grep -v require | php -w >app.lib or the like and include app.lib. - Chris