Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-8849

removePrincipalFromRole and getRoleMemberPrincipalId methods very slow

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.3
    • Component/s: Development, Performance
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-9448Performance issues with jumpTo and focusOn scripts for very large pages (ie large collections)
      KULRICE-4070XmlHelper.appendXml(Node, String) can be really slow. (i.e. takes minutes)
      KULRICE-13070Pages load really slow after rice upgrade
      KULRICE-8836Person maintenance screen loading very slowly when the person has a lot of roles
      KULRICE-12991Application startup time slow after Spring 4.0.x upgrade
      KULRICE-9835removePrincipalFromRole uses attribute id instead of attribute name in qualifier
      KULRICE-11559superuseractions.tag slows down all pages
      KULRICE-12988KC app startup time really slow with the latest rice 2.5 revision
      KULRICE-8847Role lookups slow when there are over 200 roles
      KULRICE-8929KRAD rederning is slow due to Freemarker's FMParser initializing LookaheadSuccess multiple times
    • Rice Module:
      KIM
    • Application Requirement:
      KC
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      removePrincipalFromRole and getRoleMemberPrincipalId methods perform poorly when there are about 85,000 members assigned to the role. Attaching simulated datasets for testing but this requires a KC application running because of the KIM_TYP_IDs and the attribute definition used in the dataset. Please let me know if you have trouble loading the data, a MySQL "source fileName" should do it. If you need a different format, please let me know.

      Using the test data set, a unit test to remove principals from a role with 85000 members took 11 seconds and the method getRoleMemberPrincipalId took about 1 minute. Higher execution times were observed while using actual data. Please look at the associated KCINFR-713 jira for the issue reported at IU and Eric's comment on the fix. The method assignPrincipalToRole may also require a similar fix since that is a potential place for performance enhancements also. Most of these issues with Role performance seem to be related to the RoleBo class which loads all the role members for the role. In some places, RoleBoLite has been used to improve performance but since these methods require the membership information, it might not be an option.

      1. _KimOjbSpringBeans_xml.patch
        0.8 kB
        Gayathri Athreya
      2. KCINFR-713.sql.gz
        3.41 MB
        Gayathri Athreya
      3. KCINFR-713-oracle.sql.gz
        3.71 MB
        Gayathri Athreya
      4. ProposalPermissionsAddUserToRoleTest.java
        3 kB
        Gayathri Athreya
      5. RoleDaoOjb.java
        46 kB
        Gayathri Athreya

        Issue Links

          Activity

          Hide
          Gayathri Athreya added a comment -

          Awesome, thanks Sona

          Show
          Gayathri Athreya added a comment - Awesome, thanks Sona
          Hide
          Geo Thomas (Inactive) added a comment - - edited

          I tested rice version 2.1.4-r37679 with MIT data. The unbounded Role BO lookup came up in less than a second. Earlier it used to take more than 15 minutes. Huge improvement!!!!
          I also tested PD Permission tab and Person update with different set of permissions. All looked good.
          Gayathri, We can resolve this.

          Show
          Geo Thomas (Inactive) added a comment - - edited I tested rice version 2.1.4-r37679 with MIT data. The unbounded Role BO lookup came up in less than a second. Earlier it used to take more than 15 minutes. Huge improvement!!!! I also tested PD Permission tab and Person update with different set of permissions. All looked good. Gayathri, We can resolve this.
          Hide
          Gayathri Athreya added a comment - - edited

          Yes, I am attaching the new RoleDaoOjb class and an associated patch. Use the springBeans xml patch and replace your roleDaoOjb with this one. Geo, this should speed up unbounded RoleLookups also BTW. Please test that too.

          Show
          Gayathri Athreya added a comment - - edited Yes, I am attaching the new RoleDaoOjb class and an associated patch. Use the springBeans xml patch and replace your roleDaoOjb with this one. Geo, this should speed up unbounded RoleLookups also BTW. Please test that too.
          Hide
          Geo Thomas (Inactive) added a comment -

          Gayathri,
          Is it possible to get a patch for this and apply to my local rice? I will give it a try with MIT data.
          Thanks
          Geo

          Show
          Geo Thomas (Inactive) added a comment - Gayathri, Is it possible to get a patch for this and apply to my local rice? I will give it a try with MIT data. Thanks Geo
          Hide
          Gayathri Athreya added a comment -

          So I did test this and these are the times I noted

          testRemovePrincipalFromRole - 5609 ms
          testGetRoleMemberPrincipalIds - 10530 ms
          testAssignPrincipalToRole - 6771 ms
          

          I definitely see a performance improvement but will have to wait for the testers to determine if this improves speed for them with real data. Thanks.

          Show
          Gayathri Athreya added a comment - So I did test this and these are the times I noted testRemovePrincipalFromRole - 5609 ms testGetRoleMemberPrincipalIds - 10530 ms testAssignPrincipalToRole - 6771 ms I definitely see a performance improvement but will have to wait for the testers to determine if this improves speed for them with real data. Thanks.

            People

            • Assignee:
              Sona Sona (Inactive)
              Reporter:
              Gayathri Athreya
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Structure Helper Panel