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

Awful performance from Latest Builds portlet

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      A user reports extremely slow initial page loads of a view including the Latest Builds portlet (configured to 75 builds), on an installation with ~3000 jobs with ~10 builds per job.

      Looking at LatestBuilds.getFinishedBuilds, it is clear why: this code entirely defeats the lazy-loading in 1.485+, by loading all builds records for the included jobs before sorting them. This seems unnecessary: you should be able to pick successively older builds of each job in parallel, starting with the latest, until you have determined the list of newest builds, without ever attempting to load older build records. I think the right algorithm is to create a priority queue, initially populated with the last build of each job; then loop for as many builds as must be displayed, each time extracting and displaying the latest build in the queue and then adding the previous build from the same job if there is one.

      Since the algorithm is naturally iterative, it should really be done using ProgressiveRendering so that page rendering does not block on it and so that the task can be aborted in case the user navigates away before it is finished.

        Attachments

          Activity

          Hide
          sogabe sogabe added a comment -
          Show
          sogabe sogabe added a comment - created pull request https://github.com/jenkinsci/dashboard-view-plugin/pull/20
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ssogabe
          Path:
          src/main/java/hudson/plugins/view/dashboard/builds/LatestBuilds.java
          http://jenkins-ci.org/commit/dashboard-view-plugin/4e32001a7b1d87e3fc9ec61b3be8177fb4a82a2b
          Log:
          JENKINS-18861 Awful performance from Latest Builds portlet
          TODO use ProgressiveRendering so that page rendering does not block on it
          .

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ssogabe Path: src/main/java/hudson/plugins/view/dashboard/builds/LatestBuilds.java http://jenkins-ci.org/commit/dashboard-view-plugin/4e32001a7b1d87e3fc9ec61b3be8177fb4a82a2b Log: JENKINS-18861 Awful performance from Latest Builds portlet TODO use ProgressiveRendering so that page rendering does not block on it .
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Marco Ambu
          Path:
          src/main/java/hudson/plugins/view/dashboard/builds/LatestBuilds.java
          http://jenkins-ci.org/commit/dashboard-view-plugin/0b02809f27c13b66ab411b6f74355eec89d92202
          Log:
          Merge pull request #20 from ssogabe/JENKINS-18861

          JENKINS-18861 Awful performance from Latest Builds portlet

          Compare: https://github.com/jenkinsci/dashboard-view-plugin/compare/0f6763112562...0b02809f27c1

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Marco Ambu Path: src/main/java/hudson/plugins/view/dashboard/builds/LatestBuilds.java http://jenkins-ci.org/commit/dashboard-view-plugin/0b02809f27c13b66ab411b6f74355eec89d92202 Log: Merge pull request #20 from ssogabe/ JENKINS-18861 JENKINS-18861 Awful performance from Latest Builds portlet Compare: https://github.com/jenkinsci/dashboard-view-plugin/compare/0f6763112562...0b02809f27c1
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ssogabe
          Path:
          src/main/java/hudson/plugins/view/dashboard/builds/LatestBuilds.java
          http://jenkins-ci.org/commit/dashboard-view-plugin/ec0a531e9a34f637b83acfc942a1a38e57ee0e44
          Log:
          JENKINS-18861 fixed so that it does not load useless build.
          .

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ssogabe Path: src/main/java/hudson/plugins/view/dashboard/builds/LatestBuilds.java http://jenkins-ci.org/commit/dashboard-view-plugin/ec0a531e9a34f637b83acfc942a1a38e57ee0e44 Log: JENKINS-18861 fixed so that it does not load useless build. .
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ssogabe
          Path:
          src/test/java/hudson/plugins/view/dashboard/builds/LatestBuildsTest.java
          http://jenkins-ci.org/commit/dashboard-view-plugin/a644fad79e9548625dcb142b4770b82bd93fbb3c
          Log:
          JENKINS-18861 added test for LatestBuilds.
          .

          Compare: https://github.com/jenkinsci/dashboard-view-plugin/compare/0b02809f27c1...a644fad79e95

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ssogabe Path: src/test/java/hudson/plugins/view/dashboard/builds/LatestBuildsTest.java http://jenkins-ci.org/commit/dashboard-view-plugin/a644fad79e9548625dcb142b4770b82bd93fbb3c Log: JENKINS-18861 added test for LatestBuilds. . Compare: https://github.com/jenkinsci/dashboard-view-plugin/compare/0b02809f27c1...a644fad79e95
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ssogabe
          Path:
          src/test/java/hudson/plugins/view/dashboard/builds/LatestBuildsTest.java
          http://jenkins-ci.org/commit/dashboard-view-plugin/e67447ef3d66612d094718c047be1b0be6e8763e
          Log:
          JENKINS-18861 assert max loads using assertMaxLoads
          .

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ssogabe Path: src/test/java/hudson/plugins/view/dashboard/builds/LatestBuildsTest.java http://jenkins-ci.org/commit/dashboard-view-plugin/e67447ef3d66612d094718c047be1b0be6e8763e Log: JENKINS-18861 assert max loads using assertMaxLoads .
          Hide
          jglick Jesse Glick added a comment -

          I guess this is now considered fixed?

          Show
          jglick Jesse Glick added a comment - I guess this is now considered fixed?

            People

            • Assignee:
              sogabe sogabe
              Reporter:
              jglick Jesse Glick
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: