Delay Field Rendering

Created on 26 February 2015, over 10 years ago
Updated 13 May 2025, 20 days ago

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?

πŸ’¬ Support request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ann b

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024