[pLog-svn] This is not fair
oscar at renalias.net
Fri Nov 9 07:30:43 EST 2007
It actually doesn't mean anything at all in terms of changes to the
current code, but I was planning to use some of these new features to
make our code lighter and easier to read.
For example as Mark has already pointed out, we could use __get and
__set to "magically" get rid of of most the getter and setter
functions of our database objects, or implement the ArrayIterator
interface for the PDbResultSet class so that we can operate on
database result sets as if they were arrays (so that we can use them
in foreach() loops, access members directly via , count them with
count(), etc) But in some cases using these "nicer" ways also means
that code is twice as slow to run, or even in some cases an order of
Which is why I think it is not fair :) It's not fair for developers
who know how to use these things to develop simpler code (we want nice
AND fast code!), and it's not fair to PHP as a platform either,
because it just means that people will never really use these methods
if they're so slow, and we'll be stuck with code that looks like it
belongs to the 20th century...
On Nov 9, 2007 1:46 PM, Jon Daley <plogworld at jon.limedaley.com> wrote:
> Hrm. So... what does that mean for us? I haven't been paying too
> much attention to what all you guys have been doing. Do you need to
> rewrite portions of the code? Maybe just look at stuff that gets called a
> lot? You have been looking at performance all along, I think - and there
> were various good improvements along the way, right?
> On Fri, 9 Nov 2007, Oscar Renalias wrote:
> > It doesn't help if PHP implements lots of nice OOP features (that I
> > was planning to use one day, such as Array iterators, "magic"
> > accessors via __get and __set, and so on) if by using them we incur in
> > some pretty annoyingly high performance overheads... See for
> > yourselves:
> > http://www.garfieldtech.com/blog/magic-benchmarks
> > I just wanted to vent my frustrations about this topic with you... :)
> Jon Daley
> You're just jealous because the voices are talking to me.
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
More information about the pLog-svn