Closed Bug 746870 Opened 12 years ago Closed 7 years ago

Console flushes layout by calling scrollHeight

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: bzbarsky, Unassigned)

References

Details

(Keywords: perf)

This is the #1 reason console is slow.  There are two places that get scrollHeight: ConsoleUtils_isOutputScrolledToBottom and pruneConsoleOutputIfNecessary.  This is done synchronously any time a log message is added to the console.  If this could happen async, for lots of log messages at once, that would _significantly_ speed things up.  The issue, of course, is that every layout flush has to redo XUL layout starting at the root of the document involved, which in this case is the browser UI, I bet, and XUL layout is _slow_.  Using a subframe for just the console stuff _might_ help, if that's not being done right now.  But what would help the most would be doing this work lazily.  As it is logging N messages to the console takes O(N^2) time due to this issue.
I believe you!

We'd talked about doing some sort of pagination in the console way back in the heady days of Firefox 4. Possibly implementing something where we could preallocate a bunch of empty divs to hold the scroll position and fill them up a page at a time to chunk these calls. That would probably give us a pretty significant speedup just by cutting down the scrollHeight calls.

Out of curiosity, how'd you find this?
Keywords: perf
OS: Mac OS X → All
Hardware: x86 → All
Find which?  That it's slow?  I was told by someone via e-mail.  That the issue is scrollHeight gets?  I did a profile as described in bug 746869.  The callers of scrollHeight?  I put a breakpoint in it in a debug build while running the testcase in bug 746869 and dumped the JS stack while sitting at the breakpoint.
Priority: -- → P2
Console has been re-implemented. Perf problems with the new console are being tracked in other bugs (see bug 1156747).
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.