I'm running a Drupal commerce site and using Views to display up to 30 product node teasers per page. The product display content type has a several fields (image, desc, manufacturer) and I am also using the flag module so that users can mark favorite products. As a result, the query ends up being fairly large with several joins.

Views statistics reveal that despite the complex query, the slow page loads are due to the rendering time it takes...

Are your views being cached, and are you using MEMCACHE or some similar optimiser?
–
stefgosselinMay 28 '12 at 19:15

No, views cannot be cached as each teaser rendered contains an add-to-cart form which doesn't work if cached. The HTML includes a form token specific to the original session / page view used to generate the HTML, it will be invalid once it's been cached.
–
nmcMay 28 '12 at 19:19

*More for front-side micro-optimisation, you can check your website using this online tool. It will give you valuable information on what modifications can be made in order to improve its performance.

Of course, disable/remove all modules/blocks you are not using.

Now, most of those are pretty basic and usual optimisations. I assume this is where you are now standing.

Next steps:

In my (humble) opinion, you would get way better response times if you install APC or Memcache on your server. There is also varnish I have heard lots of good things about, but I have not had the chance yet to play with it, and it looks like it is meant for anonymous sessions and static pages so I am not certain you would gain as much benefits than from other 2 above mentionned modules.

If you want to see benchmarks of a Drupal instance with/without APC caching, see here.

Last but not least, have you tried benchmarking without the flag module to see what impact this module has? We had to rewrite some queries of the like in other 3rd party modules a few times, some of the sql Drupal generates is not really optimised as you probably realised by now.

Thanks for the well-written answer. This site is on a shared host unfortunately. So, I have no access to modify MySQL settings and cannot use APC on this particular host. A quick test of removing the flag module doesn't seem to have significant impact, but I'll have to do more thorough testing later.
–
nmcMay 29 '12 at 15:26