Visiting tag page is very expensive
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).
Submitted by Elmer van Chastelet on 9 March 2012 at 12:59
Probably all publications in the tag’s publication list are loaded, while only 100 need to be displayed.
Issue Log
Logsql:
SQLs = 858, Time = 21343 ms, Entities = 56557, Collections = 136
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.
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 toPublicationList.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
Log in to post comments