Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
At the moment there is quite some logic going on, to decide whether to capture the views time etc.
This probably should be all moved into viewUI, so it's not executed on the actual page:
$config = config('views.settings');
// Set the response so other parts can alter it.
$this->response = new Response('', 200);
$start = microtime(TRUE);
if (!empty($this->live_preview) && $config->get('ui.show.additional_queries')) {
$this->startQueryCapture();
}
$exposed_form = $this->display_handler->getPlugin('exposed_form');
$exposed_form->pre_render($this->result);
// Check for already-cached output.
if (!empty($this->live_preview)) {
$cache = FALSE;
}
Comment | File | Size | Author |
---|---|---|---|
#20 | drupal-1811982-20.patch | 7.17 KB | dawehner |
#18 | drupal-1811982-18.patch | 5.58 KB | dawehner |
#17 | drupal-1849356-37.patch | 6.97 KB | dawehner |
#13 | interdiff.txt | 903 bytes | dawehner |
#13 | drupal-1811982-13.patch | 5.6 KB | dawehner |
Comments
Comment #1
damiankloip CreditAttribution: damiankloip commentedThis patch moves this logic from render on ViewExecutable to renderPreview on the ViewUI object. This is a better place for it I think. We can also lose the check for live_preview.
Comment #2
dawehnerMh people actually seems to use this #1809510: Make render time performance metric accessible in hook_views_post_render()
Comment #3
xjmComment #4
dawehnerLet's rerole and clean it up a bit.
Comment #5
dawehnerLet's rerole and clean it up a bit.
Comment #7
damiankloip CreditAttribution: damiankloip commentedI think a couple of the calls were on the ViewUI and not executable and vice versa.
Comment #9
damiankloip CreditAttribution: damiankloip commented#7: drupal-1811982-7.patch queued for re-testing.
Comment #10
dawehnerCool!
Comment #11
Dries CreditAttribution: Dries commentedDoesn't Drupal core have some timer functionality that may be re-usable here? I kinda forgot, to be honest.
Comment #12
dawehnerdries++ Wow that's pretty cool.
Working on that.
Comment #13
dawehnerThere we go.
Comment #14
damiankloip CreditAttribution: damiankloip commentedLooks good again to me, it's using the timer stuff that it seems we nearly all forgot about :)
Comment #15
tim.plunkett#13: drupal-1811982-13.patch queued for re-testing.
Comment #17
dawehnerJust another rerole. back to rtbc
Comment #18
dawehnerNothing complicated
Comment #19
damiankloip CreditAttribution: damiankloip commentedNot sure this comment is accurate now?
Comment #20
dawehnerLet's rewrite it, so it does actually work.
Comment #21
damiankloip CreditAttribution: damiankloip commented#20: drupal-1811982-20.patch queued for re-testing.
Comment #22
damiankloip CreditAttribution: damiankloip commentedJust tested this manually, works great.
Comment #23
catchOoh much nicer. Committed/pushed to 8.x.