You are here: Re: Data objects vs. speed « PHP Programming Language « IT news, forums, messages
Re: Data objects vs. speed

Posted by Jerry Stuckle on 02/19/07 13:43

lister wrote:
> I have just implemented something similar.
>
> You can structure the SELECTs in such a way that they are only run if
> the relavent information is requested from the class via a get method.
> For instance, if any of the methods requesting user information are
> called, a SELECT is run which gets all user information (since all
> info is on the same row - might as well get it all). Any further
> requests then give up this cached info rather than another SELECT.
>
> However, I share your concern with having to instantiate a large class
> for even simple queries. I am a newbie at PHP (C++ coder by trade) and
> am only now reading about the performance overheard of function calls
> and the fact that PHP will have to parse the entire class code.
>
> Is it worth the trade off? I don't know. I has certainly made the
> coding a whole lot easier and more structured. I am now implementing
> cacheing certain data in the session, and this is a snip as everything
> is accessed via the same class.
>
> I will read this thread with interest.
>
>
>
>

In a big class where you need lots of data, this would be a performance
disaster. Some of my tables have 40+ columns - and making 40+ SELECT
statements, each fetching one item, is a tremendous waste of time.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация