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

Performance: Use User#getById() instead of User#get()

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • ownership-plugin
    • None

      User#get() has serious performance issues, and starting from Jenkins 1.651 it is recommended to use another API. After JENKINS-47718 it may require another update

          [JENKINS-48707] Performance: Use User#getById() instead of User#get()

          Oleg Nenashev created issue -
          Oleg Nenashev made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Oleg Nenashev made changes -
          Link New: This issue is related to JENKINS-47718 [ JENKINS-47718 ]
          Oleg Nenashev made changes -
          Description Original: User#get() has serious performance issues, and starting from Jenkins 2.7 it is recommended to use another API. After JENKINS-47718 it may require another update New: User#get() has serious performance issues, and starting from Jenkins 1.651 it is recommended to use another API. After JENKINS-47718 it may require another update

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - https://github.com/jenkinsci/ownership-plugin/pull/68
          Oleg Nenashev made changes -
          Remote Link New: This issue links to "https://github.com/jenkinsci/ownership-plugin/pull/68 (Web Link)" [ 19537 ]
          Oleg Nenashev made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/OwnershipDescription.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPlugin.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/JobOwnerHelper.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/authorizeproject/OwnershipAuthorizeProjectStrategy.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/rolestrategy/AbstractOwnershipRoleMacro.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/rolestrategy/CoOwnerRoleMacro.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/rolestrategy/CoOwnerRoleMacroNoSid.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/rolestrategy/OwnerRoleMacro.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/rolestrategy/OwnerRoleMacroNoSid.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/util/HTMLFormatter.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/util/UserStringFormatter.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/util/UserWrapper.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/util/ui/UserSelector.java
          src/main/java/org/jenkinsci/plugins/ownership/integrations/rolestrategy/macros/CurrentUserIsOwnerMacro.java
          src/main/java/org/jenkinsci/plugins/ownership/integrations/rolestrategy/macros/CurrentUserIsPrimaryOwnerMacro.java
          http://jenkins-ci.org/commit/ownership-plugin/f6830fe0f930badc7799d64877a110b4f5c79128
          Log:
          [FIXED JENKINS-48707] - Use User#getById() in the code

          User#get() is not effective from the performance PoV, because it tries to fetch users by full name. In all calls within the plugin it is not required, hence the update should achive some performance boost.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/synopsys/arc/jenkins/plugins/ownership/OwnershipDescription.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPlugin.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/JobOwnerHelper.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/authorizeproject/OwnershipAuthorizeProjectStrategy.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/rolestrategy/AbstractOwnershipRoleMacro.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/rolestrategy/CoOwnerRoleMacro.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/rolestrategy/CoOwnerRoleMacroNoSid.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/rolestrategy/OwnerRoleMacro.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/security/rolestrategy/OwnerRoleMacroNoSid.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/util/HTMLFormatter.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/util/UserStringFormatter.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/util/UserWrapper.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/util/ui/UserSelector.java src/main/java/org/jenkinsci/plugins/ownership/integrations/rolestrategy/macros/CurrentUserIsOwnerMacro.java src/main/java/org/jenkinsci/plugins/ownership/integrations/rolestrategy/macros/CurrentUserIsPrimaryOwnerMacro.java http://jenkins-ci.org/commit/ownership-plugin/f6830fe0f930badc7799d64877a110b4f5c79128 Log: [FIXED JENKINS-48707] - Use User#getById() in the code User#get() is not effective from the performance PoV, because it tries to fetch users by full name. In all calls within the plugin it is not required, hence the update should achive some performance boost.

          Oleg Nenashev added a comment -

          Fixed in 0.11.0

          Oleg Nenashev added a comment - Fixed in 0.11.0
          Oleg Nenashev made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]

            oleg_nenashev Oleg Nenashev
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: