-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLOSED] Brackets temporarily hangs with maxed-out CPU when closing file with long lines #1332
Comments
Comment by peterflynn I ran this through the Timelines view and it's not immediately clear what's going on. Native browser operations that occur after tossing out the old editor are just very sluggish for a few seconds. Most "Layout" operations take about 700 ms (it's actually a little suspicious how close in duration they all are). There are lots of parse/style operations too but those complete very quickly. The GC events are fast, so it doesn't appear to be GC churn getting rid of all the old editor's JS state. But there might be native memory churn in a similar fashion that we're not seeing -- that could explain the native layout operations running slowly. |
Comment by peterflynn Fwiw, the various places that trigger a browser layout pass are:
Everything above takes about 8 seconds. After that, there's another 5 seconds of repaints interspersed with GC. They all look quick but there are big gaps in between where nothing happens, so it's possible the true cost of the GC events isn't being recorded right. Note: there is one obvious optimization we could do here. EditorManager._doShow() calls Editor.setVisible(), which calls refresh(); _doShow() then explicitly calls refresh() again immediately afterward. That should be easy to fix. |
Comment by pthiess Reviewed, assigned to Peter. |
Comment by peterflynn Same problem occurs with brackets-shell too |
Comment by peterflynn The problem entirely goes away if I switch to an experimental branch where the editor isn't contained in a flex-box layout (e.g. pflynn/no-editor-flex-box or Alex's patch in pull #1007). The editor closes essentially instantly in that case. |
Comment by gruehle Moving to sprint 14. |
Comment by peterflynn Moving to Sprint 15 -- too risky/disruptive a change to squeeze in now. |
Comment by peterflynn Talked to Glenn & NJ and decided I'll try to get this landed after I'm back on 10/11 (so still Sprint 15). The one open question is whether we should try the "new" flex-box syntax first. Should be cheap enough to at least verify whether it fixes this pathological case. |
Comment by redmunds FBNC to |
Comment by peterflynn Re-confirmed with latest (merged) version of fix. Closing. |
Issue by peterflynn
Thursday Aug 09, 2012 at 06:42 GMT
Originally opened as adobe/brackets#1354
Result: Brackets hangs for about 30 sec. One CPU core is maxed out for the whole duration.
Expected: Although there are known performance issues on files with very long lines, closing one should be very inexpensive.
Tearing down a vanilla CodeMirror instance containing the same text content is nearly instantaneous, so it's likely that Brackets is doing something else to cause the slowdown.
It also seems a little crazy that it only takes 3 sec to create the editor with this text, yet somehow takes 10x longer to throw it away later.
The text was updated successfully, but these errors were encountered: