Re: pearifying metabase: preparing phase 2

From: Date: Thu, 14 Feb 2002 07:14:34 +0000
Subject: Re: pearifying metabase: preparing phase 2
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-4691@lists.php.net to get a copy of this message
Hello, "Stig S. Bakken" wrote: > > The DB_result is a good desing thing, but sadly it slows a lot the > > execution because of the method calling overhead. Some time ago I did a > > new test desing dropping DB_result, and the speed gain was amazing (~50% > > faster). Finally I didn't change nothing waiting for the new Zend > > Engine, but if that doesn't solve the speed problem my bet is for doing > > the change (but that's other story :-). > > > > In short for you, imo try to avoid using DB_result as an interface for > > the driver. > > I don't think you need to worry about that now. I have a better > solution coming up in PHP 4.2: aggregate(). This is a new function that > lets you import methods from another class into an existing object. > This means we can simplify the architecture by having DB_connection and > DB_result objects importing backend-specific stuff on demand. This will > speed up simple calls a great deal (since there is less code to be > loaded always), and should reduce the result call overhead by > eleminating one layer of calls. This is one thing that concerns me about PEAR. It is not clear to me if the current PEAR code will always ship with the current PHP version. I think that PEAR should always be made independent of the current PHP version so users that can only use older PHP versions can benefit of PEAR packages. Despite Metabase still supports PHP 3 without loss, I think it is reasonable to settle with PHP 4.0.0 as a minimum requirement because I think that most users by now do not use less than that. Anyway, it should be clear for the user which version of PHP is required. If the packages could benefit of features of newer versions they should use them conditionally with code like if(function_exists("recent_function")) use recent_function() else fallback to equivalent code even if it is slower. This is how Metabase has been supporting old PHP versions. I believe this is very important because all users are good users and whenever it is possible, nobody should be left out due to limitations of the PHP version that can use and may not use any other. This is the case of many free hosting and other not so free hosting services. Only embracing as many users as we can is that I see that makes sense to merge Metabase in PEAR because I think it is important to gather as much users using a single database abstraction to maximize the PHP applications that we can all share. Regards, Manuel Lemos

« previous php.pear.dev (#4691) next »