Visiting a tag-page (at least for the tag ‘design’) takes ages to load (when entities not cached) and caused my local instance of researchr to reach GC overhead limit (2GB max).
Probably all publications in the tag’s publication list are loaded, while only 100 need to be displayed.

Submitted by Elmer van Chastelet on 9 March 2012 at 12:59

On 9 March 2012 at 15:29 Elmer van Chastelet commented:

Logsql:

SQLs = 858, Time = 21343 ms, Entities = 56557, Collections = 136


On 9 March 2012 at 20:38 Elmer van Chastelet commented:

A single call to list.publications.length in the following template forces the servlet to load all entities from that list, i.e. +-54000 in case of tag ‘design’. That’s what we call an expensive if-statement ;)

define span publicationList(list : PublicationList) {
  // init{ list.update(); }
  placeholder publicationList {
    if(list.publications.length == 0) {
      par{ "No publications in this list." }
    } else {
      publicationsByYear(list, 0)
    }
  }
}

The tagSidebar template also triggers loading of all publications in that list.


On 10 March 2012 at 17:50 Elmer van Chastelet commented:

I’ve added a .size() function to the PublicationList entity, which uses HQL’s count to determine the size of PublicationList.publications. Replaced 2 occurences of calls to PublicationList.publication.length, probably there are similar cases for other entities which could hinder performance.

Logsql of the design tag page, now using .size():

SQLs = 843, Time = 4396 ms, Entities = 1055, Collections = 134


On 13 July 2012 at 14:16 Eelco Visser tagged 63

On 13 July 2012 at 14:16 Eelco Visser closed this issue.

Log in to post comments