Closed Bug 1578587 Opened 6 years ago Closed 10 months ago

CodeMirror 1min+ hangs on large minified files when clicking through from Console

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Harald, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [debugger-reserve])

STR:

  1. Open Console on https://www.notion.so/Station-s-public-roadmap-030f47e10b36450f91377035949b51ba?p=6b8d066194de4999acd53b2fb44108b8
  2. Follow a log link to app*.js to open it in Debugger

AR: 160s hang on Quantum reference machine. MBP isn't much better.

Windows profile: https://perfht.ml/32s9Yih
Again CodeMirror</Et.prototype.column and js::str_indexOf.

ER: Open in reasonable time.

I could not get a hang when opening the file directly from the Debugger sources list, so maybe bug 1553291 helped with that

Summary: CodeMirror chokes on large minified files, causing main thread hands in Debugger → CodeMirror 1min+ hangs on large minified files when clicking through from Console
Blocks: dbg-71
Whiteboard: [debugger-mvp]

it looks like part of this is the fact that app-*.js has 24090 scripts.

Whiteboard: [debugger-mvp] → [debugger-reserve]

In the case that a file is ultra-massive, like this one, should we show a warning message before trying to render its contents? Rendering message may signal to the user that the debugger may not be as responsive. Text editors have this pattern.

That might be useful, but this assumes that users might want to not open the file. If an issue happens in a heavy file, the user doesn't have much of a choice, right?

But having an upper limit and having a prompt UI similar to Atom or VSCode would be still good to have to prevent freezes of more than a few sec.

I'm not sure if it matters to the current discussion, but the time to load the source file in the STR was significantly improved by bug 1569829, to around 7 seconds.
There are still two reflows that take place - I think one is caused by measurements performed by CodeMirror.charCoords() in scrollToColumn().
I haven't found a good way around that yet except for using CodeMirror.scrollIntoView() instead, which has different behavior.
Before: https://perfht.ml/3213tDs
After: https://perfht.ml/2IvTLB6

(In reply to :Harald Kirschner :digitarald from comment #0)

STR:

  1. Open Console on https://www.notion.so/Station-s-public-roadmap-030f47e10b36450f91377035949b51ba?p=6b8d066194de4999acd53b2fb44108b8
  2. Follow a log link to app*.js to open it in Debugger

AR: 160s hang on Quantum reference machine. MBP isn't much better.

I can reproduce this today, on Dell XPS, Ubuntu. ~5s hang.

I could not get a hang when opening the file directly from the Debugger sources list, so maybe bug 1553291 helped with that

In contrast, I also get the same length of hang when opening the file directly from the sources list.

Severity: normal → S3

This performance issues no longer exists.

Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.