View Single Post
  #11  
Old 02-06-2008, 10:09 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default Re: Variants on the Productlist

I just looked at the code, and wow, their implementation method is horrible. What they did was build a loop that runs through each product listed on the page. Then for each product, they include the Product Options and Wholesale modules.

The method of including per product is fine, when it's only 1 product. The way they've implemented means that they are running possibly 5+ additional queries per product. While this allows you to upgrade easily in the future (because they didn't make major changes to how Product Options works by default), this is one of the worse methods that you could implement regarding performance

Typically, you would build such a modification so that you grab *all* product options for *all* products, in one query. so, instead of 75+ new queries (assuming 15 products per page), you would have a max of 1-3 new queries per page (1-3 because there might be an extra query or 2 to grab additional info for all those products)

@Jonjolt: I still appreciate you posting this code, as this could be used as the basis for a better implementation, just wanted to make others aware of the performance cost and server strain this could cause.
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote