Uploaded image for project: 'Kernel'
  1. Kernel
  2. KNL-1493

SiteService.getUserSites should have way to pre-filter sites (Sites drawer slow with lots of sites)

    Details

    • 12 status:
      Resolved
    • 11 status:
      Merge
    • Test Plan:
      Hide
      • I believe to test this you'd have to be a member of a LOT of sites, say like 1000.
      • Then you go into your preferences, Sites and unselect all of the sites from the site drawer.

      Normally none of these would display on the More Sites dropdown, however the first load would still take a long time (and subsequent loads would still take a little time). The ideal is that all loads are fast if you exclude sites.

      Show
      I believe to test this you'd have to be a member of a LOT of sites, say like 1000. Then you go into your preferences, Sites and unselect all of the sites from the site drawer. Normally none of these would display on the More Sites dropdown, however the first load would still take a long time (and subsequent loads would still take a little time). The ideal is that all loads are fast if you exclude sites.

      Description

      A new feature from 11 is the More Sites drawer. This calls a method in

      SiteNeighbourhoodServiceImpl->getAllSites
      https://github.com/sakaiproject/sakai/blame/master/portal/portal-service-impl/impl/src/java/org/sakaiproject/portal/service/SiteNeighbourhoodServiceImpl.java

      This was improved a little bit in KNL-1011, but previously in 10 you could turn this off with the setting portal.use.dhtml.more=false. In 11 there is only this one default.

      The way it works is it runs a query to get all the user's sites.
      mySites = siteService.getUserSites(false);

      And then later in this code it filters this list to remove the ones that they've selected to hide as a user preference. The problem with this is serious performance for users with a lot of sites. It caches these sites so it's faster after the first time and whenever the cache expires, but the first time can be up to 30-60 seconds.

      What it seems like we really need is a way to either have the SiteService take into account the user preferences for what sites to exclude (maybe via a boolean flag) or be able to be passed as a parameter a list of sites to exclude. I feel like it can just use the preference directly.

      Then as part of the query it just would exclude these sites right at the database level and not even load them. This should really improve performance for people who are enrolled in many sites (but have most of them hidden/excluded)

      It might be another problem if you are actually in a lot of sites but aren't excluding any, we might just want a limit (say like 500 or maybe 1000) or how many sites will display on this More Sites dropdown. Then and indication to the user that they'd have to exclude some sites for others to come up.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  farreri Miguel Pellicer
                  Reporter:
                  jonespm Matthew Jones
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: