Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-49276

My Sites portlet takes a long time to render

    Details

      Description

      1.Go to Server Admin -> Log levels, add com.liferay.portal.service.persistence.UserFinderImpl as info level.

      2.in UserFinderImpl.java, print the code execute time:

      protected List<Long> countByC_FN_MN_LN_SN_EA_S(
      Session session, long companyId, String[] firstNames,
      String[] middleNames, String[] lastNames, String[] screenNames,
      String[] emailAddresses, int status,
      LinkedHashMap<String, Object> params, boolean andOperator) {
      
      String sql = CustomSQLUtil.get(COUNT_BY_C_FN_MN_LN_SN_EA_S);
      
      .....
      if (status != WorkflowConstants.STATUS_ANY)
      { qPos.add(status); }
      
      // List<Long> results = q.list(true);
      
      stopWatch.stop();
      _log.info(q.list(true).size());
      _log.info("List<Long> countByC_FN_MN_LN_SN_EA_S execution time " + stopWatch.getTime() + " ms");
      
      stopWatch.reset();
      
      stopWatch.start();
      List<Long> results = q.list(true); // It costs some times and affects the performance.
      stopWatch.stop();
      _log.info("result " + stopWatch.getTime() + " ms");
      
      _log.info("result list size: " + (results != null ? results.size(): 0));
      
      return q.list(true);
      }
      

      In our code, it should occur in userIds.addAll(countByC_FN_MN_LN_SN_EA_S(session, companyId, firstNames, middleNames, lastNames,screenNames, emailAddresses, status, params1, andOperator)) ;(This code should take effect the same as "List<Long> results = q.list(true)")

      Result: If one site's user have 50000 users, it will take 1800ms(1.8s). So if I have 10 sites and per site has 50000 users, it will take 18s to render.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lu.liu Lu Liu
              Reporter:
              hai.yu Hai Yu
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 15 weeks, 2 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 M3