Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Revisions: Issue #37277 Back to Issue ]
Summary 0037277: Change the role in the ERP has performance problems
Revision 2017-12-14 12:18 by vmromanos
Steps To Reproduce Login in the ERP
Open developer tools
Change the role to a role with access to many organizations
Notice that UserInfoWidgetActionHandler request takes around 18s
Revision 2017-12-14 12:18 by vmromanos
Description In an environment with many organizations, get General Ledger of context organizations part in LoginUtils.java (specifically, the loop by organization and selectAcctSchema inside) is very slow (takes around 17s).

slow part:

        // Get General Ledger of context organizations
        if (ArrayUtils.isEmpty(attr)) {
          String[] orgList = Utility.getContext(conn, vars, "#User_Org", "LoginHandler")
              .replace("'", "").split(",");
          for (String orgId : orgList) {
            if (!StringUtils.equals(orgId, strOrg)) {
              acctSchemaId = OBLedgerUtils.getOrgLedger(orgId);
              if (StringUtils.isNotEmpty(acctSchemaId)) {
                attr = AttributeData.selectAcctSchema(conn, acctSchemaId,
                    Utility.getContext(conn, vars, "#User_Client", "LoginHandler"));
                if (ArrayUtils.isNotEmpty(attr)) {
                  break;
                }
              }
            }
          }
        }
Revision 2017-12-14 12:17 by vmromanos
Steps To Reproduce Login in the ERP
Open developer tools
Change the role to a role with access to many organizations
Verify this piece of code is slow.
Revision 2017-12-14 12:17 by vmromanos
Description In an environment with many organizations, get General Ledger of context organizations part in LoginUtils.java (specifically, the loop by organization and selectAcctSchema inside) is a bit slow and could be improved.

slow part:

        // Get General Ledger of context organizations
        if (ArrayUtils.isEmpty(attr)) {
          String[] orgList = Utility.getContext(conn, vars, "#User_Org", "LoginHandler")
              .replace("'", "").split(",");
          for (String orgId : orgList) {
            if (!StringUtils.equals(orgId, strOrg)) {
              acctSchemaId = OBLedgerUtils.getOrgLedger(orgId);
              if (StringUtils.isNotEmpty(acctSchemaId)) {
                attr = AttributeData.selectAcctSchema(conn, acctSchemaId,
                    Utility.getContext(conn, vars, "#User_Client", "LoginHandler"));
                if (ArrayUtils.isNotEmpty(attr)) {
                  break;
                }
              }
            }
          }
        }

The system searches for a valid acct schema using a dummy algorithm. If we search using a smarter way, we could improve the performance of this piece.
Revision 2017-12-12 12:11 by vmromanos
Steps To Reproduce Login in the ERP
Open developer tools
Change the role to a role with access to many organizations
Notice that UserInfoWidgetActionHandler request takes around 18s
Revision 2017-11-13 11:14 by Sandrahuguet
Description In an environment with many organizations, get General Ledger of context organizations part in LoginUtils.java (specifically, the loop by organization and selectAcctSchema inside) is very slow (takes around 17s).

slow part:

        // Get General Ledger of context organizations
        if (ArrayUtils.isEmpty(attr)) {
          String[] orgList = Utility.getContext(conn, vars, "#User_Org", "LoginHandler")
              .replace("'", "").split(",");
          for (String orgId : orgList) {
            if (!StringUtils.equals(orgId, strOrg)) {
              acctSchemaId = OBLedgerUtils.getOrgLedger(orgId);
              if (StringUtils.isNotEmpty(acctSchemaId)) {
                attr = AttributeData.selectAcctSchema(conn, acctSchemaId,
                    Utility.getContext(conn, vars, "#User_Client", "LoginHandler"));
                if (ArrayUtils.isNotEmpty(attr)) {
                  break;
                }
              }
            }
          }
        }
Revision 2017-11-13 10:23 by Sandrahuguet
Description In an environment with many organizations, get General Ledger of context organizations part in LoginUtils.java (specifically, selectAcctSchema inside the loop) is very slow (takes around 17s).

slow part:

        // Get General Ledger of context organizations
        if (ArrayUtils.isEmpty(attr)) {
          String[] orgList = Utility.getContext(conn, vars, "#User_Org", "LoginHandler")
              .replace("'", "").split(",");
          for (String orgId : orgList) {
            if (!StringUtils.equals(orgId, strOrg)) {
              acctSchemaId = OBLedgerUtils.getOrgLedger(orgId);
              if (StringUtils.isNotEmpty(acctSchemaId)) {
                attr = AttributeData.selectAcctSchema(conn, acctSchemaId,
                    Utility.getContext(conn, vars, "#User_Client", "LoginHandler"));
                if (ArrayUtils.isNotEmpty(attr)) {
                  break;
                }
              }
            }
          }
        }
Revision 2017-11-13 10:20 by Sandrahuguet
Description In an environment with many organizations, get General Ledger of context organizations part in LoginUtils.java is very slow (takes around 17s).

slow part:

        // Get General Ledger of context organizations
        if (ArrayUtils.isEmpty(attr)) {
          String[] orgList = Utility.getContext(conn, vars, "#User_Org", "LoginHandler")
              .replace("'", "").split(",");
          for (String orgId : orgList) {
            if (!StringUtils.equals(orgId, strOrg)) {
              acctSchemaId = OBLedgerUtils.getOrgLedger(orgId);
              if (StringUtils.isNotEmpty(acctSchemaId)) {
                attr = AttributeData.selectAcctSchema(conn, acctSchemaId,
                    Utility.getContext(conn, vars, "#User_Client", "LoginHandler"));
                if (ArrayUtils.isNotEmpty(attr)) {
                  break;
                }
              }
            }
          }
        }
Revision 2017-11-13 10:18 by Sandrahuguet
Description In an environment with many organizations, get General Ledger of context organizations part in LoginUtils is very slow (takes around 17s).

slow part:

        // Get General Ledger of context organizations
        if (ArrayUtils.isEmpty(attr)) {
          String[] orgList = Utility.getContext(conn, vars, "#User_Org", "LoginHandler")
              .replace("'", "").split(",");
          for (String orgId : orgList) {
            if (!StringUtils.equals(orgId, strOrg)) {
              acctSchemaId = OBLedgerUtils.getOrgLedger(orgId);
              if (StringUtils.isNotEmpty(acctSchemaId)) {
                attr = AttributeData.selectAcctSchema(conn, acctSchemaId,
                    Utility.getContext(conn, vars, "#User_Client", "LoginHandler"));
                if (ArrayUtils.isNotEmpty(attr)) {
                  break;
                }
              }
            }
          }
        }


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker