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

Reuse XStream instance when doing portlet import

    Details

      Description

      Steps to Test Performance - 62x
      1. Create 2000 users (script addManyUsers-62x.groovy)
      2. Run the below script to see the time it takes for each thread to drop the aforementioned users:

      import java.util.concurrent.*;
      import com.liferay.portal.model.*;
      import com.liferay.portal.service.*;
      import com.liferay.portal.util.*;
      
      long start = System.currentTimeMillis();
      ExecutorService pool = Executors.newFixedThreadPool(8);
      
      for (User user : UserLocalServiceUtil.getUsers(0, 9000)) {
          if (user.isDefaultUser() || PortalUtil.isOmniadmin(user.getUserId())) {
              continue;
          } 
          pool.execute(deleteUser(user.getUserId()));
      }
      
      private Runnable deleteUser(final Long userId) {
          return new Runnable() {
              @Override
              void run() {
                  long inStart = System.currentTimeMillis();
                  UserLocalServiceUtil.deleteUser(userId)
                  System.out.println("Individual deleted in " + (System.currentTimeMillis()-inStart)+" ms");
              }
          }
      }
      
      System.out.println("All users deleted in: "+ (System.currentTimeMillis()-start)+"ms");
      

      Expected result: Delete times stays near-constant per user
      Actual result: Delete times steadily increases from ~300 ms to up to 6-7 seconds per user, after which it somehow resets back to ~300ms and starts again (given high enough number of users)


      QA Notes
      You can ignore the errors like

      java.lang.Error: com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portal.kernel.repository.RepositoryException: There is no valid repository class with class name id 32477
      

      upon executing the deletion script.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 5 weeks ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP16
                  7.0.3 CE GA4
                  7.0.0 DXP SP4
                  7.0.X EE
                  Master