• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • sectioned-view-plugin
    • None
    • CentOS 7
      Jenkins v1.642.4
      Sectioned View Plugin v1.20

      Jenkins views of type Sectioned View are much slower to load than the standard views even for trivial cases. In our most simple test case we created a sectioned view with a single section which displays a list of jobs based on a regular expression to which we use ".*" to display every job. When comparing the load times of this test view against the default "all" view, the former takes approximately 25s on average to load where as the latter takes less than 4 seconds to load. Also for comparison I created a new basic list view and configured the same regular expression to display all available jobs and the load time was comparable to the "all" view. So in this test case the sectioned view was over 6 times slower to load than the comparables.

      Further, if one creates multiple sections in the sectioned view the performance decreases even further, with load times reaching in excess of 1-2 minutes in some of our test cases. In extreme cases such views even time out because the load times are so slow.

      As another test case I tried restricting the sectioned view so the section(s) had a more restrictive regular expression so only a small subset of all of our available jobs are being displayed (ie: a few dozen matches instead of a few thousand). This seemed to have no appreciable effect, which seems to suggest the issue is somehow associated with the section filters and not the number of jobs matched by the filter.

      If anyone has any suggestions on what might be causing this slow down feel free to let me know, however thus far it would appear there is some unique behavior to job filters applied to a sectioned view that make it much less efficient than the built in list views and thus may be a bug with the sectioned view plugin that needs to be fixed.

      NOTE: We do have quite a few plugins installed in our Jenkins instance, but to try and minimize the impact of the other plugins I have configured our test views to only display a single column in each view which displays the name of the job (ie: excluding columns that may need to access build history and such, like the weather column, the build status column, etc.) and the results are pretty much consistent.

          [JENKINS-37174] Sectioned View filters slow to load

          Oliver Gondža added a comment - Related: https://github.com/jenkinsci/sectioned-view-plugin/pull/7

          I have dug a bit deeper into this and the plugin does some redundant data crunching while loading the sectioned view. For every section items are filtered which is not all that expensive but due to the nature of the plugin, this is done for ever section configured. Tree times for some of them, in fact. I managed to cut it down to 2 easily[1] but eliminating the last duplicate calculation will be more tricky. Core's View/index.jelly pull all the sectioned view items which invokes one last unnecessary pass through all items - the result is completely ignored by the plugin. The options seems to be

          • Replace index.jelly with plugin specific one so this is not invoked. Duplicity to maintain.
          • Make SectionedView#getItems to return empty collection. Can be a problem in different situations.
          • Cache job listings per section for a short period of time / for the time of view rendering so repeated calls are fast.

          [1] https://github.com/jenkinsci/sectioned-view-plugin/pull/17

          Oliver Gondža added a comment - I have dug a bit deeper into this and the plugin does some redundant data crunching while loading the sectioned view. For every section items are filtered which is not all that expensive but due to the nature of the plugin, this is done for ever section configured. Tree times for some of them, in fact. I managed to cut it down to 2 easily [1] but eliminating the last duplicate calculation will be more tricky. Core's View/index.jelly pull all the sectioned view items which invokes one last unnecessary pass through all items - the result is completely ignored by the plugin. The options seems to be Replace index.jelly with plugin specific one so this is not invoked. Duplicity to maintain. Make SectionedView#getItems to return empty collection. Can be a problem in different situations. Cache job listings per section for a short period of time / for the time of view rendering so repeated calls are fast. [1] https://github.com/jenkinsci/sectioned-view-plugin/pull/17

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          src/main/java/hudson/plugins/sectioned_view/SectionedView.java
          src/main/resources/hudson/plugins/sectioned_view/JobGraphsSection/main.jelly
          src/main/resources/hudson/plugins/sectioned_view/ListViewSection/main.jelly
          src/main/resources/hudson/plugins/sectioned_view/TestResultViewSection/main.jelly
          http://jenkins-ci.org/commit/sectioned-view-plugin/a0e46f03b2cc936b49012f6a6ed33b247f89d895
          Log:
          JENKINS-37174 Eliminate some of the duplicate item crunching

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/hudson/plugins/sectioned_view/SectionedView.java src/main/resources/hudson/plugins/sectioned_view/JobGraphsSection/main.jelly src/main/resources/hudson/plugins/sectioned_view/ListViewSection/main.jelly src/main/resources/hudson/plugins/sectioned_view/TestResultViewSection/main.jelly http://jenkins-ci.org/commit/sectioned-view-plugin/a0e46f03b2cc936b49012f6a6ed33b247f89d895 Log: JENKINS-37174 Eliminate some of the duplicate item crunching

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          pom.xml
          src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java
          src/main/java/hudson/plugins/sectioned_view/SectionedViewSectionDescriptor.java
          src/main/resources/hudson/model/View/index.jelly
          src/test/java/hudson/plugins/sectioned_view/SectionedViewTest.java
          http://jenkins-ci.org/commit/sectioned-view-plugin/e7ddff1e52eae5ac7d927ffd04d63c7162ed9e9d
          Log:
          [FIXED JENKINS-37174] Do not enumerate section items repeatedly while loading the view

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: pom.xml src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java src/main/java/hudson/plugins/sectioned_view/SectionedViewSectionDescriptor.java src/main/resources/hudson/model/View/index.jelly src/test/java/hudson/plugins/sectioned_view/SectionedViewTest.java http://jenkins-ci.org/commit/sectioned-view-plugin/e7ddff1e52eae5ac7d927ffd04d63c7162ed9e9d Log: [FIXED JENKINS-37174] Do not enumerate section items repeatedly while loading the view

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          pom.xml
          src/main/java/hudson/plugins/sectioned_view/SectionedView.java
          src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java
          src/main/java/hudson/plugins/sectioned_view/SectionedViewSectionDescriptor.java
          src/main/resources/hudson/model/View/index.jelly
          src/main/resources/hudson/plugins/sectioned_view/JobGraphsSection/main.jelly
          src/main/resources/hudson/plugins/sectioned_view/ListViewSection/main.jelly
          src/main/resources/hudson/plugins/sectioned_view/TestResultViewSection/main.jelly
          src/test/java/hudson/plugins/sectioned_view/SectionedViewTest.java
          http://jenkins-ci.org/commit/sectioned-view-plugin/c58b77a0c584d02b80dedcc08e29528aff2c2e2f
          Log:
          Merge pull request #17 from olivergondza/JENKINS-37174

          JENKINS-37174 Eliminate some of the duplicate item crunching

          Compare: https://github.com/jenkinsci/sectioned-view-plugin/compare/1e3dec5aac6b...c58b77a0c584

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: pom.xml src/main/java/hudson/plugins/sectioned_view/SectionedView.java src/main/java/hudson/plugins/sectioned_view/SectionedViewSection.java src/main/java/hudson/plugins/sectioned_view/SectionedViewSectionDescriptor.java src/main/resources/hudson/model/View/index.jelly src/main/resources/hudson/plugins/sectioned_view/JobGraphsSection/main.jelly src/main/resources/hudson/plugins/sectioned_view/ListViewSection/main.jelly src/main/resources/hudson/plugins/sectioned_view/TestResultViewSection/main.jelly src/test/java/hudson/plugins/sectioned_view/SectionedViewTest.java http://jenkins-ci.org/commit/sectioned-view-plugin/c58b77a0c584d02b80dedcc08e29528aff2c2e2f Log: Merge pull request #17 from olivergondza/ JENKINS-37174 JENKINS-37174 Eliminate some of the duplicate item crunching Compare: https://github.com/jenkinsci/sectioned-view-plugin/compare/1e3dec5aac6b...c58b77a0c584

            tbingaman Timothy Bingaman
            leedega Kevin Phillips
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: