I have a view with a result set consisting of 749 rows, and 24 fields in each row. I'm using the Tree (Adjacency model) format.

In order to display a branch of the tree at a time, I did an override of function theme_views_tree($variables). Code can be found here. This was a small change. Using a custom form, the user selects an option from a drop down menu that automatically submits the form. The nid of the option is passed to the server in the url (using http request method get).

The view page is slow. I'm learning how to use XHProf and narrowed down the problem to the views_handler_field::theme(...) function being called in views_plugin_style::render_fields(...) 749 x 24 = 17976 times. The issue is most of these rows are not needed when only displaying a branch of the tree, so no need to theme them. Is there any way to delay the render_fields(...) themeing until later in the process, when we know which rows in the view will actually be displayed?

Comments

ann b’s picture

Issue summary: View changes