Bug 142011 - Web Inspector: Make console faster, only render last N messages in the DOM
Summary: Web Inspector: Make console faster, only render last N messages in the DOM
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on: 155629 157368
Blocks: 152220
  Show dependency treegraph
 
Reported: 2015-02-25 00:33 PST by Nikita Vasilyev
Modified: 2016-12-13 15:40 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2015-02-25 00:33:41 PST
Having thousands of messages in the console can make it slow. Display only last 500 messages to reduce amount of elements in the DOM and thus reduce memory consumption.

Either add "Show previous 100 messages" button or just load them when we scroll to the top edge of the console.

I’m not sure about the numbers, I need to do some stress testing first.
Comment 1 Radar WebKit Bug Importer 2015-02-25 00:34:01 PST
<rdar://problem/19950261>
Comment 2 Nikita Vasilyev 2015-11-12 14:43:32 PST
While working on code hotness visualizer, I've been logging objects every time I get data from the backend, approximately every second. Running inspector over 10 minutes makes the whole UI interface unbearably slow.

The following code shouldn't drastically affect Web Inspector performance after running for 10 minutes:

setInterval(function() {
    console.log({x: Math.random()})
}, 1000);
Comment 3 Nikita Vasilyev 2015-12-12 21:01:17 PST
See also:
<rdar://problem/23527135>
Comment 4 Nikita Vasilyev 2016-02-16 03:49:28 PST
I’d prefer to have a generic solution that would
also work for big data grids (e.g. in Timelines).
Comment 5 Nikita Vasilyev 2016-03-08 22:15:31 PST
As far as I can tell, we store console messages data only in the DOM.
We don't have an array of WebInspector.ConsoleMessage instances in
WebInspector.JavaScriptLogViewController or anywhere else.

My first step would be to store WebInspector.ConsoleMessage instances
in WebInspector.JavaScriptLogViewController, so I can render them later
when needed.
Comment 6 Nikita Vasilyev 2016-03-09 21:51:11 PST
The first step I'd like to tackle is to render console
messages only when the split console is visible or the console
tab is active.

AFAIK, there is currently no event like "console-show".
The closest I've found so far is
WebInspector.QuickConsole.Event.DidResize event and
WebInspector.consoleContentView.visible getter.
Comment 7 Timothy Hatcher 2016-03-09 23:13:17 PST
(In reply to comment #6)
> The first step I'd like to tackle is to render console
> messages only when the split console is visible or the console
> tab is active.
> 
> AFAIK, there is currently no event like "console-show".
> The closest I've found so far is
> WebInspector.QuickConsole.Event.DidResize event and
> WebInspector.consoleContentView.visible getter.

LogContentView  would get hidden() and shown() called on them. Implementing those could call other code, like on JavaScriptLogViewController.