Created attachment 301388 [details] [Image] Screenshot of Issue This seems to be controlled by <http://codemirror.net/3/doc/manual.html#option_maxHighlightLength>.
Created attachment 301389 [details] Patch
Could you includes steps to reproduce? The screenshot without context doesn't illustrate the issue.
Comment on attachment 301389 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=301389&action=review > Source/WebInspectorUI/UserInterface/Views/TextEditor.js:45 > + maxHighlightLength: Infinity, I think we should only make this infinity if we have line wrapper. If we don't have line wrapping it ends up being a huge performance problem. (And maybe then we should make it something like 2000 instead of the 10000 that is the default).
Comment on attachment 301389 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=301389&action=review >> Source/WebInspectorUI/UserInterface/Views/TextEditor.js:45 >> + maxHighlightLength: Infinity, > > I think we should only make this infinity if we have line wrapper. If we don't have line wrapping it ends up being a huge performance problem. (And maybe then we should make it something like 2000 instead of the 10000 that is the default). Based on what I can see in the CodeMirror source, I don't think setting changing the maxHighlightLength really effects much. It seems to only apply to how much of a single line is processed for syntax highlighting, not the entire file. As such, checking if line wrapping is enabled seems to be unnecessary. <https://github.com/codemirror/CodeMirror/search?q=maxHighlightLength>
(In reply to comment #2) > Could you includes steps to reproduce? The screenshot without context > doesn't illustrate the issue. 1. Go to <http://devinrousso.com> 2. Open WebInspector to the Resources tab 3. Select "common.css" in the navigation sidebar 4. Scroll down in that file (or until you find ".spinner")
(In reply to comment #5) > (In reply to comment #2) > > Could you includes steps to reproduce? The screenshot without context > > doesn't illustrate the issue. > > 1. Go to <http://devinrousso.com> > 2. Open WebInspector to the Resources tab > 3. Select "common.css" in the navigation sidebar > 4. Scroll down in that file (or until you find ".spinner") 5. Disable Pretty Print Sorry, forgot that step :P
(In reply to comment #4) > Comment on attachment 301389 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=301389&action=review > > >> Source/WebInspectorUI/UserInterface/Views/TextEditor.js:45 > >> + maxHighlightLength: Infinity, > > > > I think we should only make this infinity if we have line wrapper. If we don't have line wrapping it ends up being a huge performance problem. (And maybe then we should make it something like 2000 instead of the 10000 that is the default). > > Based on what I can see in the CodeMirror source, I don't think setting > changing the maxHighlightLength really effects much. It seems to only apply > to how much of a single line is processed for syntax highlighting, not the > entire file. As such, checking if line wrapping is enabled seems to be > unnecessary. > <https://github.com/codemirror/CodeMirror/search?q=maxHighlightLength> Okay. It should be trivial to test this. With your existing test case (or one that is much larger like say 50000 characters), set highlight length to 2000 or Infinity and gauge how long it feels with line wrapping disabled. If it really does look/feel the same then I'm sold. But in the past this (or something related) was the cause of hangs in Web Inspector. The search link you provide shows a highlight_worker so it is possible things have changed.
(In reply to comment #7) > Okay. It should be trivial to test this. With your existing test case (or > one that is much larger like say 50000 characters), set highlight length to > 2000 or Infinity and gauge how long it feels with line wrapping disabled. If > it really does look/feel the same then I'm sold. But in the past this (or > something related) was the cause of hangs in Web Inspector. The search link > you provide shows a highlight_worker so it is possible things have changed. OK I think I misunderstood what your point was. Yes, the maxHighlightLength does affect the performance of CodeMirror, and the lower the value the faster it renders. What I was trying to say was that changing this value only affects the syntax highlighting on a single line, and that changing this value doesn't affect shorter lines. If line wrapping and pretty print are both disabled, however, there is a noticeable worsening of the performance of larger files. In light of this, I think your point is valid and we shouldn't make this change.