Like the title says...
My content type contains cck node references which can number in the 100s in some cases. GHPs containing nodes with lots of references can take upwards of a minute to load up! It looks like the slowdown is occurring in node.views.inc in template_preprocess_views_view_row_node() with the call to node_view(). The time taken by node_view() is directly proportional to the number of node references for a particular node, up to 10 seconds for a node with 300-some node references for example (although there is nothing shocking about this).
On my GHP, I don't really care about the referenced nodes at all -- I'm just displaying a title and a thumbnail image, so I should be able to render the parent nodes a lot more quickly, right?
I'm using a clone of the built in og_ghp_ron, and right now, I'm just looking at the preview function in views. Initially, I had a hunch that I should be able to override template_preprocess_views_view_row_node() in my theme, but then (outside of preview), template_preprocess_views_view_row_node gets called anyway, in addition to my own version in my theme -- I can't seem to get away from it.
Can anyone suggest any strategies for speeding up the loading of my group home pages? Naturally, strategies that do not involve anything below the theme layer are especially welcome!
Thanks for thinking about this!
Comments
Comment #1
dawehnerViews just uses the drupal core mechanism which is provided node_view.
So what you probably should do: don't add 300 node references to a node.
If you would look at the full node itself, too, it would require a long time, too.
I think the only thing you could do is
a) use fields instead of node as row style plugin
b) don't build such gigantic nodes.
Comment #2
jleonard commentedYes, individual pages are slow to load as well, but that's OK. Without getting into the details, lots of node references are what they asked for, that's what they are getting!
a) was the answer I was looking for -- thanks for helping to improve my views-fu. This does exactly what I wanted.
Thanks for the timely and helpful response.
Comment #3
dawehnerCool.
Nevertheless you should try to remove such many items.