Updated views to speed up admin pages

Commented out recordCount function in feedback and site_migration_list views.

/* ### 11-5-12 This function is running slow and causing page load slowdowns. Commenting out for now. Vid
function recordCount($viewName,$displayName){
    $view = views_get_view($viewName);
    return count($view->result);
//get the record count:
//ex: $totalCount=recordCount('feedback','attachment_1');

That function was running very slow; 540ms per page load in the case of the migration block. Perhaps it’s the lack of caching or that it lived in a php footer of the view. I’m not sure. But php 5.3 slowed that way down.
I did notice there were 20k feedback records so the fact that it had to total that number on every page load probably wasn’t helping.
I also found the source of the array_flip() error that’s been present since the php 5.3 upgrade; It was likely unrelated to the upgrade. One of the site migration blocks had a missing view field value as it’s url title and that was causing the problem.

Things are much faster now.

Leave a Comment