Re: PHP performance
| From: | Eric Butera | Date: | Tue, 04 Mar 2008 13:39:36 +0000 |
| Subject: | Re: PHP performance | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-270905@lists.php.net to get a copy of this message | ||
On Tue, Mar 4, 2008 at 5:51 AM, Jochem Maas <jochem@iamjochem.com> wrote:
> Eric Butera schreef:
>
>
> > On Mon, Mar 3, 2008 at 6:18 PM, Chris <dmagick@gmail.com> wrote:
> >> > Just FYI, using ADODB will slow down the performance of your app. Any
> >> > function calls cost against you and it all adds up.
> >>
> >> If you remove it, then you remove functionality - so before you go and
> >> rip it out, check whether it's the bottleneck using xdebug.
> >>
> >> I use an abstraction layer all the time and the benefits far outweigh
> >> the 'costs'.
> >>
> >> --
> >> Postgresql & php tutorials
> >> http://www.designmagick.com/
> >>
> >
> > Hi Chris,
> >
> > These 'benefits' you talk about really only matter if you switch your
> > databases. If this app is written against Oracle and they never plan
> > to change it, then it isn't a bad idea to cut out that fat and just
> > deal with the native interface. Even writing wrapper functions that
> > are very basic that abstract mysql_query or mssql_query end up adding
> > a lot of overhead over lots of requests. Look at some of the PDO
> > benchmarks. It is slower than the native functions too because it is
> > just a wrapper.
> >
> > Even further if you are writing an app where you care about
> > performance you should be writing your SQL to the point where it
> > really isn't portable using all the little vendor specific features so
> > that you get the most out of it.
> >
> > From my personal profiling most of my application time is spent in
> > data access. So the less layers you have there the faster it runs.
>
> the adodb php layers are insignificant compared to the cost of the db connection
> and the round trip to retrieve data from the db. the significant application time
> you speak of is undoubtly spent at the database performing and retrieving the
> data as opposed to measurable overhead caused by a [number of] wrapper function[s].
>
> high probability that SQL related tweaks (indexing, query restructuring, db tuning)
> will win you much, much more than removing any db abstraction layer
>
>
> >
> > But that is just my 2cents on it. :)
> >
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Hi Jochem,
This is probably true. I was just referring to an old benchmark [1] I
had seen a few years ago.
Of course the biggest win will come from an opcode cache if that is a
possibility.
Just for the record I do use a db wrapper myself but I have weighed
the pros and cons of the situation and determined that it works for
me. I have many low traffic sites so it makes sense to have a wrapper
that delays connections until they're used and such other little
tweaks.
I listen to peoples recoded talks from conferences and I've heard on
many occasions that on single apps they take out the db abstraction.
I wish I could cite references but it is out there if you want to dig
enough.
[1] http://phplens.com/lens/adodb/