[wp-hackers] SELECT DISTINCT .... ORDER BY not working....

Computer Guru computerguru at neosmart.net
Wed Nov 21 06:02:05 GMT 2007


It's been a while since I did C++ (all C# for me now!), but I used to be
quite good.

But it's not necessary - that's my problem.

Take a look at my homepage: http://neosmart.net/blog/
It loads in either .1something or .0003something seconds. First is when the
XCache is clear, second is when the cache is available.

Basically, I rewrote my homepage from scratch (it doesn't use any WordPress
functions, objects, libraries, etc. just the database) and it performs
GREAT.

This is proof that PHP isn't really the problem so much as a general
disregard for high-performance coding practice, such as avoiding nested
loops.

But the biggest difference was in caching the output of FOR loops instead of
the SQL that they use.

And it's a big difference.... My old homepage would load in .6-.8 seconds.
You can see a post (for instance,
http://neosmart.net/blog/2007/windows-vista-sp1-rc1-server-2008-nov-ctp-released-to-testers/
)
which loads in ~.3 seconds.

PHP is slow, yes. But it's not *that* slow that I should get 5 req/sec!

(Jacob, I'm sending you an email about the C++ thing).

-CG


On 11/21/07, Jacob <wordpress at santosj.name> wrote:
>
> Computer Guru wrote:
> > On 11/21/07, Stephane Daury <wordpress at tekartist.org> wrote:
> >
> >
> >> Of course, having some fined tune indices bundled with the installer,
> >> based on the queries the code runs (at least the major ones) and not
> >> just the primary keys, would be a nice step forward being more
> >> efficient with our madness right out of the box. ;-)  Let's us be a
> >> bit more feature/stability minded at the code level, rather than worry
> >> about performance at every corner. Then again, being attentive at the
> >> latter level is always an appreciated plus.
> >>
> >> Stephane
> >>
> >>
> > Actually, my problem is with the PHP.
> > MySQL is very finely-tuned on my server, and has never given me any
> problems
> > under load - it's PHP that balks when I get slashdotted.
> >
> > But at any rate, I think it's *always* important to keep Performance in
> > mind, because it doesn't require *not* doing or adding or changing any
> > features - it just requires that you do them in a certain way, and pay
> > attention to the stuff that's going on.
> >
> > For instance, instead of just caching SQL results, it would be a
> ten-fold
> > performance boost to cache the results of some of the larger FOR loops
> in
> > the code....
> >
> > Logically speaking, MySQL is compiled/native code, PHP isn't - we really
> > need to give PHP performance attention to; not just MySQL.
> >
> > just my 2 cents.
> > -CG
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> If that is the case, then let the mass WordPress PHP Extension writing
> commence. It would go a lot quicker if more people worked on it. Anyone
> know C/C++ really well?
>
> There is only such much you can do userland to improve performance,
> without using Opcode caching. If you were to say, take that chunk of FOR
> loop and write it in C/C++, it would be that much faster. However, I
> would advise to keep SQL and database connections in userland as once
> you like compile something, it is extremely difficult to upgrade that
> something, as oppose to just dropping in new files over the old
> uncompiled ones.
>
> --
>
> Jacob Santos
>
> http://www.santosj.name - blog
> http://wordpress.svn.dragonu.net/unittest/ - unofficial WP unit test
> suite.
>
> Also known as darkdragon and santosj on WP trac.
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Computer Guru
Director,
NeoSmart Technologies
http://neosmart.net/blog/


More information about the wp-hackers mailing list