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

Prism slows down web browser when showing a large XML file

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • prism-api-plugin
    • Jenkins 2.452.1
      Prism API Plugin Version 1.29.0-15
      Warnings Plugin Version 11.3.0
      Firefox 11.51.0esr

      A build reports warnings on eight lines of a largish XML file (7246 lines, 1907943 bytes), and the Warnings Plugin displays those warnings in a table. When I click the first warning (on line 950 of the file), the Warnings Plugin attempts to display the XML file and scroll to the corresponding line.

      It takes longer than one minute before the line and the warning become visible. Even then, the subsequent lines of the file are not visible, and the Process Manager of Firefox shows that the tab is using 98% of CPU time and gradually accumulating memory (I saw 15 GB). I run the five-second profile from the Process Manager and it shows the time is being spent this call stack:

      • 10% get Node.childNodes
      • 33% /jenkins/static/3da8a64b/plugin/prism-api/js/prism/keep-markup/prism-keep-markup.min.js:1:752
      • 72% /jenkins/static/3da8a64b/plugin/prism-api/js/prism/keep-markup/prism-keep-markup.min.js:1:752
      • 91% /jenkins/static/3da8a64b/plugin/prism-api/js/prism/keep-markup/prism-keep-markup.min.js:1:752
      • 92% /jenkins/static/3da8a64b/plugin/prism-api/js/prism/keep-markup/prism-keep-markup.min.js:1:752
      • 92% (root scope) /jenkins/static/3da8a64b/plugin/prism-api/js/prism/keep-markup/prism-keep-markup.min.js:1:1403
      • 92% forEach [self-hosted:203:21]
      • 92% run /jenkins/static/3da8a64b/plugin/prism-api/js/prism/prism-core.min.js:1:4368
      • 100% setTimeout handler

      I hope there is a way to make this faster; perhaps by disabling syntax highlighting in large files, or by showing only a dozen lines around the warning.

          [JENKINS-73298] Prism slows down web browser when showing a large XML file

          Ulli Hafner added a comment -

          Yes, it makes sense to either run the coloring in a background thread or to skip it for large files.

          Ulli Hafner added a comment - Yes, it makes sense to either run the coloring in a background thread or to skip it for large files.

          Given the memory consumption, I think it would be better to skip the coloring than do it in the background.

          Kalle Niemitalo added a comment - Given the memory consumption, I think it would be better to skip the coloring than do it in the background.

          Alain added a comment -

          I'm having a similar issue on Jenkins 2.440.3 with Warnings Plugin 11.3.0 and Prism API 1.29.0-15. Having a build report (.log file with 7561 lines and 883301 bytes), viewing the warning message in the log file on Chrome 125.0.6422.144, generates an html page with more than 44000 nodes, that is very slow to load, if the tab doesn't crash with out of memory error.

          I can see that the log file is detected to be "language-clike", however I am not interested in any syntax highlighting, but only scrolling to the line number. I cannot find in the docs of warnings-ng plugin how to disable coloring, any hints please?

          Alain added a comment - I'm having a similar issue on Jenkins 2.440.3 with Warnings Plugin 11.3.0 and Prism API 1.29.0-15. Having a build report (.log file with 7561 lines and 883301 bytes), viewing the warning message in the log file on Chrome 125.0.6422.144, generates an html page with more than 44000 nodes, that is very slow to load, if the tab doesn't crash with out of memory error. I can see that the log file is detected to be "language-clike", however I am not interested in any syntax highlighting, but only scrolling to the line number. I cannot find in the docs of warnings-ng plugin how to disable coloring, any hints please?

          Ulli Hafner added a comment -

          It is not possible to disable syntax highlighting.

          Ulli Hafner added a comment - It is not possible to disable syntax highlighting.

            Unassigned Unassigned
            kon Kalle Niemitalo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: