WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
153634
Web Inspector: some background tabs think they are the foreground tab and do unnecessary work
https://bugs.webkit.org/show_bug.cgi?id=153634
Summary
Web Inspector: some background tabs think they are the foreground tab and do ...
Joseph Pecoraro
Reported
2016-01-28 20:44:28 PST
Created
attachment 270177
[details]
[IMAGE] Profile of reloading page with inspector * SUMMARY Background Tabs waste a lot of time on reload populating editor content. * STEPS TO REPRODUCE 1. Inspect webkit.org 2. Resources > select a resource 3. Debugger > select a different resource 4. Show Console Tab 5. Reload => ~300ms of frontend time (85%) is spent populating source code text editor content for the resources in the background tabs * NOTES - It may be fine for the background tabs to fetch the content, but not to process it! - See attached screenshot for a profile
Attachments
[IMAGE] Profile of reloading page with inspector
(220.73 KB, image/png)
2016-01-28 20:44 PST
,
Joseph Pecoraro
no flags
Details
Clean profile
(262.63 KB, image/png)
2016-05-29 08:41 PDT
,
Blaze Burg
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2016-01-28 20:44:50 PST
<
rdar://problem/24404173
>
Joseph Pecoraro
Comment 2
2016-01-28 20:52:53 PST
This seems to be another case where the background view thinks it is visible! The background tab's SourceCodeTextEditor thinks "this.visible" is true.
Joseph Pecoraro
Comment 3
2016-01-28 21:01:12 PST
Wow, merely opening the inspector all ContentViews that are initially created are marked as visible: Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) OverviewTimelineView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) OverviewTimelineView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) OverviewTimelineView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) TimelineRecordingContentView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) OverviewTimelineView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) ConsoleTabContentView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) LogContentView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) TextResourceContentView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) ResourceClusterContentView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) TextResourceContentView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) TextResourceContentView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) FrameDOMTreeContentView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) TextResourceContentView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) ResourceClusterContentView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) TextResourceContentView Resources/Views/ContentView.js:209:22: CONSOLE TRACE visible (true) TextResourceContentView This was me opening to the Console tab. This could be contributing to inspector launch time performance issues as well. The background tabs shouldn't need to do anything until they are first interacted with.
Blaze Burg
Comment 4
2016-01-29 08:49:49 PST
Nice find!
Matt Baker
Comment 5
2016-02-03 15:12:04 PST
I have a patch in progress for
https://webkit.org/b/150741
, which pushes visibility state management into the View base class. I'll check that it resolves this issue.
Timothy Hatcher
Comment 6
2016-04-05 13:41:42 PDT
***
Bug 156076
has been marked as a duplicate of this bug. ***
Blaze Burg
Comment 7
2016-05-29 08:41:01 PDT
Seems to be resolved. I attached a profile of Web Inspector^1 while reloading CNN.com, following Joe's steps to reproduce. Codemirror does not appear anywhere in the profile.
Blaze Burg
Comment 8
2016-05-29 08:41:27 PDT
Created
attachment 280060
[details]
Clean profile
Joseph Pecoraro
Comment 9
2016-06-01 13:16:03 PDT
This is definitely not fixed. We are just fortunate that most of the work (Formatting, unnecessarily inserting for color widgets in JavaScript, etc) have been eliminated (moved to a Worker, unnecessary work eliminated) as part of the performance work done in the last 6 months. While the performance impacts of cases we knew about have diminished, its certainly possible that a future issue could be introduced. We also know of correctness issues caused by this (a background tab, thinking it is active, steals a SourceCodeTextEditor from the foreground tab). I'm going to reopen.
Blaze Burg
Comment 10
2016-06-01 13:57:17 PDT
(In reply to
comment #9
)
> This is definitely not fixed. We are just fortunate that most of the work > (Formatting, unnecessarily inserting for color widgets in JavaScript, etc) > have been eliminated (moved to a Worker, unnecessary work eliminated) as > part of the performance work done in the last 6 months. > > While the performance impacts of cases we knew about have diminished, its > certainly possible that a future issue could be introduced. We also know of > correctness issues caused by this (a background tab, thinking it is active, > steals a SourceCodeTextEditor from the foreground tab). > > I'm going to reopen.
OK. Can you please retitle appropriately? If you have steps to reproduce the correctness issue, that would be great too.
Joseph Pecoraro
Comment 11
2016-11-16 15:59:38 PST
In recent months this issues means the Timeline Tab and Network Tab are constantly doing empty rAF loops, and in some cases causing non-stop console assertions. Short term fix on
bug 164841
, but just another indication that we should fix this.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug