Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions /

PaginatedList Slow


Reply


2 Posts   513 Views

Avatar
wardog

Community Member, 9 Posts

17 November 2012 at 11:59am

Currently I have a site that its news section has more than 600 News with SS2.4 not had the problem of page load time and now the whole process is what gets the pagination does not understand all query "Articles" but you do and this is making it impossible to work with the gesture someone has a suggestion or solution to this problem ..

I've seen some forum post that comment as well.

============================================================================
PROFILER OUTPUT
============================================================================
Calls Time Routine
-----------------------------------------------------------------------------
5 70803.7958 ms (90.96 %) obj.PaginatedPages
1 4063.7081 ms (5.22 %) obj.GetRandomArticles
60 1234.4096 ms (1.59 %) obj.Link
1 489.7299 ms (0.63 %) all_execution
1 296.8569 ms (0.38 %) obj.Children
8 179.1608 ms (0.23 %) SSViewer::process
7 149.5395 ms (0.19 %) obj.CssClass
14 108.5079 ms (0.14 %) obj.MenuTitle
2 107.7521 ms (0.14 %) obj.Menu
1 75.8519 ms (0.10 %) obj.GetFullBanner
10 50.8358 ms (0.07 %) obj.LimitWordCount
1 48.6469 ms (0.06 %) obj.PaginationSummary
58 34.4119 ms (0.04 %) obj.Title
1 31.7068 ms (0.04 %) obj.Getarticles
7 28.3129 ms (0.04 %) obj.LinkingMode
1 23.3231 ms (0.03 %) DB::connect
3 17.6811 ms (0.02 %) obj.MetaTitle
1 14.2679 ms (0.02 %) obj.BreadcrumbsUL
10 7.5481 ms (0.01 %) obj.Status
14 6.8796 ms (0.01 %) obj.ClassName
10 6.3541 ms (0.01 %) obj.Content
10 6.0790 ms (0.01 %) obj.ID
5 6.0022 ms (0.01 %) obj.RecordClassName
7 5.2361 ms (0.01 %) obj.LinkOrCurrent
1 3.6600 ms (0.00 %) obj.Form
8 1.9894 ms (0.00 %) Requirements::includeInHTML
1 1.4040 ms (0.00 %) obj.Parent
2 1.3528 ms (0.00 %) obj.MetaDescription
7 1.2717 ms (0.00 %) obj.CurrentBool
2 1.0779 ms (0.00 %) obj.MetaKeywords
3 1.0321 ms (0.00 %) obj.themedir
6 1.0140 ms (0.00 %) obj.PageNum
1 0.9830 ms (0.00 %) main.php init
1 0.9532 ms (0.00 %) obj.ThemeDir
1 0.8931 ms (0.00 %) obj.GA
1 0.6030 ms (0.00 %) obj.NextLink
1 0.3920 ms (0.00 %) obj.MoreThanOnePage
1 0.3412 ms (0.00 %) obj.NotLastPage
1 0.3281 ms (0.00 %) obj.NotFirstPage
1 0.2148 ms (0.00 %) obj.SiteConfig
1 0.0401 ms (0.00 %) unprofiled

23.2069 ms (0.03 %) Missed
============================================================================
77837.3551 ms (100.00 %) OVERALL TIME
============================================================================

public function PaginatedPages() {
return new PaginatedList($this->Children(),$this->request);
}

Avatar
wardog

Community Member, 9 Posts

20 November 2012 at 5:37pm

This is not a real solution. but it has worked a bit so minimizing the loading time for any reason if you use the above function makes a query for each file in the DB the problem is how to do the count summary "Prev | 1 | 2 | 3 | 4 | 5 | ... | Next "querys makes them 5 times to count not how it is structured now SS3 but really that's the problem I'm working on making a DataObject classe compatible and work.

public functionPaginatedPages
{
$ob = DB::query('SELECT Count(*) From SiteTree_Live WHERE ParentID=' . $this->ID)->value();
      $rs = new ArrayList();
      for($a=0;$a<=$ob;$a++) {
         $rs->push(array(rand() => rand()));
      }
      $rsp = new PaginatedList($rs);
}