Re: MDB slower than DB ?

From: Date: Fri, 13 Dec 2002 14:14:25 +0000
Subject: Re: MDB slower than DB ?
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-11611@lists.php.net to get a copy of this message
<smith@dybnet.de> wrote : >> >> Could this be slower because of getOne() ? > > PEAR::DB does something very uncouth in the get*() methods: > The methods are very long instead of separating the different task into > smaller methods. MDB uses the fetch*() methods in its get*() methods to > make the code easier to read and maintain. Obviously this adds another > function call. So maybe its another case of maintainability vs. > performance. > > If you do not intent to pass a prepared query to getOne() then probably > what you really want to use is queryOne() which is slightly lighter than > getOne() since it does not allow you to pass prepared query parameters. > > So maybe you will be able to regain some of your lost performance using > queryOne(). > > The applies for all other get*() methods as well: if you don’t want to > use prepared queries with it rather use query*() ... > > Finally MDB has a larger memory footprint for obvious reasons which can > obviously fill up your memory faster but if that would happen > performance would probably be very miserable for you. Memory is not a problem for me :) I changed all getOne to queryOne and it's indeed faster. Still, it's slower than PEAR DB. Pear DB is 0.40 MDB getOne is 0.49 MDB queryOne is 0.44 Let me know if you can think of any other performance optimization settings.. Thanks Lucas, Bertrand Mansion Mamasam

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