Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55916

Performance: Rewriting RoleMap#RoleWalker such that it includes a breaking(aborting) logic, reducing the execution time in many cases and avoid creation of new collection for roles every time RoleWalker is invoked, reducing the memory usage.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Current implementation of RoleMap does not have logic to abort or break the flow after a particular role, if there were such feature, running time can be reduced in a number of cases. Further every time RoleWalker is called, it invokes walk() which creates a new collection of roles every time, it can be avoided.

        Attachments

          Activity

          deepansh_nagaria Deepansh Nagaria created issue -
          Hide
          deepansh_nagaria Deepansh Nagaria added a comment - - edited

          I propose a fairly simple approach of both the problems listed: A class variable abort which when set to true terminates the loop and making the collection roles as global variable of outer class solves the issue of it being created on every call of walk().

          https://github.com/jenkinsci/role-strategy-plugin/pull/58

          Show
          deepansh_nagaria Deepansh Nagaria added a comment - - edited I propose a fairly simple approach of both the problems listed: A class variable abort which when set to true terminates the loop and making the collection roles as global variable of outer class solves the issue of it being created on every call of walk(). https://github.com/jenkinsci/role-strategy-plugin/pull/58
          deepansh_nagaria Deepansh Nagaria made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          deepansh_nagaria Deepansh Nagaria made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Deepansh Nagaria PR 58 was released in Role Strategy 2.10. IIUC now we need a PR to apply the performance patch itself, right?

          Show
          oleg_nenashev Oleg Nenashev added a comment - Deepansh Nagaria PR 58 was released in Role Strategy 2.10. IIUC now we need a PR to apply the performance patch itself, right?
          Hide
          deepansh_nagaria Deepansh Nagaria added a comment - - edited

          Oleg Nenashev sir https://github.com/jenkinsci/role-strategy-plugin/pull/54 is the application of the performance patch for #getRolesHavingPermission() method using abort() logic. If I see some other part which implements this logic I shall propose a follow-up PR.

          Show
          deepansh_nagaria Deepansh Nagaria added a comment - - edited Oleg Nenashev sir https://github.com/jenkinsci/role-strategy-plugin/pull/54 is the application of the performance patch for #getRolesHavingPermission() method using abort() logic. If I see some other part which implements this logic I shall propose a follow-up PR.
          deepansh_nagaria Deepansh Nagaria made changes -
          Status In Review [ 10005 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              deepansh_nagaria Deepansh Nagaria
              Reporter:
              deepansh_nagaria Deepansh Nagaria
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: