Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11485 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71646 invoked by uid 1010); 22 Jul 2004 22:03:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 71622 invoked from network); 22 Jul 2004 22:03:16 -0000 Received: from unknown (HELO mrout3.yahoo.com) (216.145.54.173) by pb1.pair.com with SMTP; 22 Jul 2004 22:03:16 -0000 Received: from bourbon.corp.yahoo.com (bourbon.corp.yahoo.com [216.145.53.135]) by mrout3.yahoo.com (8.12.10/8.12.10/y.out) with ESMTP id i6MM2YiJ088493; Thu, 22 Jul 2004 15:02:34 -0700 (PDT) Received: (from andrei@localhost) by bourbon.corp.yahoo.com (8.12.9/8.11.1) id i6MM2Ywj066841; Thu, 22 Jul 2004 15:02:34 -0700 (PDT) (envelope-from andrei@gravitonic.com) X-Authentication-Warning: bourbon.corp.yahoo.com: andrei set sender to andrei@gravitonic.com using -f Date: Thu, 22 Jul 2004 15:02:34 -0700 To: Andi Gutmans Cc: internals@lists.php.net Message-ID: <20040722220233.GA65903@gravitonic.com> References: <5.1.0.14.2.20040722142558.041b3e10@127.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.2.20040722142558.041b3e10@127.0.0.1> User-Agent: Mutt/1.4.1i Subject: Re: [PHP-DEV] realpath() caching From: andrei@gravitonic.com (Andrei Zmievski) Attachment didn't come through. On Thu, 22 Jul 2004, Andi Gutmans wrote: > Hi guys, > > Before 5.0.0 we promised we'll get something together for solving the > performance problems caused by Zend always realpath()'ing include files (in > expand_filepath()). > Attached is a proposed implementation of such a cache. We tried to make it > as simple as possible and tests shows that it solves the performance > problems. > A few facts about it: > a) Expiration and Cache size are still hardcoded and not INI options in > tsrm_virtual_cwd.h. Didn't want to go through the trouble of doing it > because we agree on the implementation. > b) tsrm_hash.* is a full blown hash and not a stripped down hash which is > all that's needed for this. It'll be stripped down. > c) In my opinion and tests, having a memory limit on the cache works great > because it makes sure the cache doesn't go crazy and even in like 16K of > memory you can usually cache all of the realpath()'s. > d) Current expiration for an entry is 2 minutes which is also plenty. > e) I wouldn't make it much more complicated or "smarter" than this because > it'll just add lots of code and will probably not perform much better. > > Comments welcome. Let's get this baby into PHP 5.1! > > Andi > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php - Andrei