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

VERY poor performance with large test history when viewing results.

    XMLWordPrintable

Details

    Description

      It takes about 20 sec to display any part of the test report when the json file is big enough and there are lots of previous builds.

      Attachments

        Activity

          teilo James Nord added a comment -

          Will. Attempt to reproduce

          teilo James Nord added a comment - Will. Attempt to reproduce

          thanks!
          and sorry for annoying me

          bubenkoff Anatoly Bubenkov added a comment - thanks! and sorry for annoying me
          teilo James Nord added a comment -

          Comment from reporter:

          "This only happens if there is a large (100+) build history"

          This may indicating a recursive load issue - re-opened to investigate.

          teilo James Nord added a comment - Comment from reporter: "This only happens if there is a large (100+) build history" This may indicating a recursive load issue - re-opened to investigate.

          I can share a result of our investigation.

          The poor performance of Cucumber Test Result Plugin caused by the logic of displaying test results.
          Each time when users are visiting Cucumber Test Result page, Cucumber plugin loads previous build results (for calculating age of failed tests).
          In case if current build is success plugin load only one previous result, but in case if a build is failed Cucumber plugin will load previous recursively for calculating a Scenario fail age.

          This behavior has issues:
          1. Method getResult() is synchronized (This mean that only one user can load report for one job).
          2. Cucumber plugin is trying to cache test result in WeakReference class field.
          3. Calculating of fail age has not optimized algorithm. Cucumber plugin calculates fail age separately for each scenario. That's mean that for 10 failed scenarios in one build, the plugin will try to open (or read from a cached field) the XML results 10 times.

          You can see here screenshot with visual VM. When I tried to open a report with 10 failed scenarios in a row Cucumber Plugin is used ~200mb and ~20% of CPU for GC. (Totally we have 868 scenarios)

          vitaliy_skrypnyk Vitaliy Skrypnyk added a comment - I can share a result of our investigation. The poor performance of Cucumber Test Result Plugin caused by the logic of displaying test results. Each time when users are visiting Cucumber Test Result page, Cucumber plugin loads previous build results (for calculating age of failed tests). In case if current build is success plugin load only one previous result, but in case if a build is failed Cucumber plugin will load previous recursively for calculating a Scenario fail age. This behavior has issues: 1. Method getResult() is synchronized (This mean that only one user can load report for one job). 2. Cucumber plugin is trying to cache test result in WeakReference class field. 3. Calculating of fail age has not optimized algorithm. Cucumber plugin calculates fail age separately for each scenario. That's mean that for 10 failed scenarios in one build, the plugin will try to open (or read from a cached field) the XML results 10 times. You can see here screenshot with visual VM. When I tried to open a report with 10 failed scenarios in a row Cucumber Plugin is used ~200mb and ~20% of CPU for GC. (Totally we have 868 scenarios)
          teilo James Nord added a comment -

          vitaliy_skrypnyk to be clear you are 100% correct and this is by design. There is no guarantee that previous builds have finished when the later build completes. This is the same in the junit plugin.

          The slow behavior is due to Memory pressure - if you had more memory available then the prior results would be in memory and would not need to be loaded and parsed - although there is potential that some thing could be improved in this area.

          > Cucumber plugin calculates fail age separately for each scenario

          this is still required as you do not need to view all scenarios - they can be viewed individually, so calculating this for all scenarios when you are viewing a single scenario will be equally sub-optimal.

          teilo James Nord added a comment - vitaliy_skrypnyk to be clear you are 100% correct and this is by design. There is no guarantee that previous builds have finished when the later build completes. This is the same in the junit plugin. The slow behavior is due to Memory pressure - if you had more memory available then the prior results would be in memory and would not need to be loaded and parsed - although there is potential that some thing could be improved in this area. > Cucumber plugin calculates fail age separately for each scenario this is still required as you do not need to view all scenarios - they can be viewed individually, so calculating this for all scenarios when you are viewing a single scenario will be equally sub-optimal.

          People

            Unassigned Unassigned
            bubenkoff Anatoly Bubenkov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: