You could simply recall the constructor if the object exist. This way you do not create the objects for every data entry you have and aviously it will use less ressources.
Also like someone else told you, Get a Debuger! It will point out the slow part of your code. For example i had 30 000 lines of code in php5 oo (templating system + e-com) to generate a page it would take 0.3 seconds. I concider this as not too bad. Yann On Thu, 2004-08-19 at 07:26, Krzysztof Gorzelak wrote: > > > Each object gets data from mysql by itself. The generation time of 1 > > > category [30 products, 10 keys, 5 values ~= 300 mysql queries] takes as > I > > > said more than a 1s (on quite fast machine). How can this model be > improved? > > > > Why are you doing 300(!!!) mysql queries? > > I guess you can retrieve the same data with much less queries. > > 300 queries are slow ... not OOP. > > > > Well, I changed my script a little for tests and turned off the queries. Now > I'm setting some defaults data to those 300 objects but it's still too slow. > I create for every value, key and product a different object so it's in fact > 30*10*5 objects. Then I run __toString() method one by one and generate my > page. Is it proper to creating a separate objects for all values ? It makes > my code much more easy... > > Krzysztof Gorzelak > [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php