Extreme slow Views rendering time On my Drupal 7 site I have some heavy performance problems. I found out (with XHProf) that the cause of that problem are some Views. The strange thing is: not the query build time nor the query execute time are to slow, but the views rendering time:

Query build time    4.83 ms
Query execute time  3.29 ms
View render time    1175.82 ms 


The view is complicated because it has 7 relations. So that its build and execute time is as long as it actually shows up in the example above, is what one would expect. But the rendering can not depend on the complexity of the query, right? But only on the complexity of the resulting array or something else. 
So, my question is, where to start to optimize View render time?

ps.: If the view is cached it much faster. But I have to optimize its over all execution time, when it's not cache or can't be cached.
Views can create real bottleneck for scaling and often cause great head ache by becoming resource hungry if not optimized well. Especially the use of Left Joins instead of Inner Joins, the default pagination in views and features like Distinct are major causes for the same.

The below code is a quick sample implementation which probably could fix the join issue in a view.

/**
* Implements hook_views_query_alter().
*
* This disables distinct and turns LEFT joins into INNER joins. This increases
* performance.
*/
function my_module_views_query_alter(&amp;$view, &amp;$query) {
if ($view-&gt;name == "my_view") {
$query-&gt;table_queue['content_type_article']['join']-&gt;type = 'INNER';
$query-&gt;distinct = 0;
}
}


Also, check if you can enable views cache. You can set the interval to something based on your update frequency or try to clear views_cache when something is updated on the site.

Use of views_litepager instead of the default page can also help, if you are using pagination in views.

There are several things you can do. You could read this detailed post on the topic for a more detailed understanding.