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

Warnings Plugin: Slow Performance on customized parsing rules with Regular Expression

    XMLWordPrintable

Details

    Description

      I encountered severe performance problems when using the customized warnings parser plugin with regex. It takes about a minute to parse the 250kb file in the attachment for warnings. Even a simple regex like just "INFO" takes 40 sec for the attached file.

      A 6 MB log file took about 18 minutes with a slightly more difficult script. When I tested a log on java with about the same size and similar amount of categories, it terminated after 2 seconds.

      Skript:

      import hudson.plugins.warnings.parser.Warning
      return new Warning("fileName", 1, "Dynamic Parser", "category" , "normal")
      

      Regex:

      ^([A-Z]+):(\s)*\[(.*)\].*at:\s(\w+\.java)\((\d+)\)(\s)*$
      

      Attachments

        Activity

          tschmetzer Tobias Schmetzer created issue -
          drulli Ulli Hafner made changes -
          Field Original Value New Value
          Description Hello,

          I encountered severe performance problems when using the customized warnings parser plugin with regex.
          It takes about a minute to parse the 250kb file in the attachment for warnings. Even a simple regex like just "INFO" takes 40 seks for the attached file.
          A 6 MB log file took about 18 minutes with a slightly more dificult skript.
          When I tested a log on java with about the same size and similar amount of categorys, it terminated after 2 seconds.

          Skript:
          import hudson.plugins.warnings.parser.Warning
          return new Warning("fileName", 1, "Dynamic Parser", "category" , "normal")

          Regex:
          ^([A-Z]+):(\s)*\[(.*)\].*at:\s(\w+\.java)\((\d+)\)(\s)*$
          I encountered severe performance problems when using the customized warnings parser plugin with regex. It takes about a minute to parse the 250kb file in the attachment for warnings. Even a simple regex like just "INFO" takes 40 sec for the attached file.

          A 6 MB log file took about 18 minutes with a slightly more difficult script. When I tested a log on java with about the same size and similar amount of categories, it terminated after 2 seconds.

          Skript:
          {code}
          import hudson.plugins.warnings.parser.Warning
          return new Warning("fileName", 1, "Dynamic Parser", "category" , "normal")
          {code}
          Regex:
          {code}
          ^([A-Z]+):(\s)*\[(.*)\].*at:\s(\w+\.java)\((\d+)\)(\s)*$
          {code}

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/warnings/parser/DynamicParser.java
          src/main/java/hudson/plugins/warnings/parser/GroovyExpressionMatcher.java
          src/test/java/hudson/plugins/warnings/parser/DynamicParserTest.java
          src/test/java/hudson/plugins/warnings/parser/ParserSpeed.java
          src/test/resources/hudson/plugins/warnings/parser/issue14383.txt
          http://jenkins-ci.org/commit/warnings-plugin/976c8cd3e383bdfb2eab378035d37cff5091e8ef
          Log:
          [FIXED JENKINS-14383] Parse the groovy script only once.

          Compare: https://github.com/jenkinsci/warnings-plugin/compare/21a0cedfe5bd...976c8cd3e383

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/warnings/parser/DynamicParser.java src/main/java/hudson/plugins/warnings/parser/GroovyExpressionMatcher.java src/test/java/hudson/plugins/warnings/parser/DynamicParserTest.java src/test/java/hudson/plugins/warnings/parser/ParserSpeed.java src/test/resources/hudson/plugins/warnings/parser/issue14383.txt http://jenkins-ci.org/commit/warnings-plugin/976c8cd3e383bdfb2eab378035d37cff5091e8ef Log: [FIXED JENKINS-14383] Parse the groovy script only once. Compare: https://github.com/jenkinsci/warnings-plugin/compare/21a0cedfe5bd...976c8cd3e383
          scm_issue_link SCM/JIRA link daemon made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 145019 ] JNJira + In-Review [ 191309 ]

          People

            drulli Ulli Hafner
            tschmetzer Tobias Schmetzer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: