Bug 35216

Summary: Web Inspector: REGRESSION: hangs when scrolling in Resource pane
Product: WebKit Reporter: Jeff Johnson <opendarwin>
Component: Web Inspector (Deprecated)Assignee: Pavel Feldman <pfeldman>
Status: RESOLVED INVALID    
Severity: Normal CC: burg, pfeldman, robert.colburn+bugzilla
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: OS X 10.6   
URL: http://www.youtube.com/watch?v=jqxENMKaeCU
Attachments:
Description Flags
Samples of Safari
none
[PATCH] Proposed fix.
none
Sample of Safari svn r55353 none

Description Jeff Johnson 2010-02-21 12:44:45 PST
Created attachment 49163 [details]
Samples of Safari

Overview:
There is a performance regression in the Resources pane of the Web Inspector from stock Safari 4.0.4 (6531.21.10) on Mac OS X 10.6.2 to WebKit TOT (r55052). Scrolling in the source of a large javascript file, for example, is very slow and can cause the Web Inspector and Safari to hang.

Steps to Reproduce:
1) Launch Terminal
2) WebKit/WebKitTools/Scripts/run-safari
3) Open http://www.youtube.com/watch?v=jqxENMKaeCU
4) Show Web Inspector
5) Select Resources pane
6) Enable resource tracking for this session, if not enabled
7) Select www-core-new-vfl147421.js in the resources list
8) Scroll up and down in the js source

Actual Results:
Scrolling is instantaneous.

Expected Results:
Scrolling is slow and causes Safari to hang and pinwheel.

Build Date & Platform:
WebKit svn r55052 built from source, Debug configuration, Mac OS X 10.6.2 Build 10C540, Xcode 3.2.1

Additional Information:
What seems to be happening is that the web inspector is continuously performing syntax highlighting. It syntax highlights the section at the top, then when I scroll down the text is all black, it syntax highlights, but when I scroll back to the top, the formerly highlighted text is now all black again, and then it gets syntax highlighted again.

This problem occurs whether or not I have ClickToFlash installed, so it has nothing to do with whether there is actually a Flash movie playing on the web page.

Attached are two samples of Safari, archived in the file "InspectorSamples.zip".
Comment 1 Pavel Feldman 2010-02-21 13:11:29 PST
Could it be that you are comparing Debug ToT to Release 4.0.4?
Comment 2 Jeff Johnson 2010-02-23 08:49:47 PST
That's correct. I just tried nightly build r55140, and it doesn't pinwheel, though it can be a bit jerky. Thus, as far as Debug builds are concerned, I can't really say how much of a regression there has been. I don't think the Safari 4.0.4 version has been tagged in svn.

As you mentioned in #webkit, this may be a problem with parsing very long lines of javascript. The code was changed to parse files continuously rather than just once, so some regression was expected, but I hope you agree that Debug builds should still remain usable, especially for this purpose, which is javascript debugging.

Let me know if you want me to perform further testing.

On a side note, is there a reason that line-wrapping is no longer used in the Resources pane? Without line-wrapping, it's harder to read js files with long lines.
Comment 3 Pavel Feldman 2010-02-26 14:04:38 PST
Created attachment 49635 [details]
[PATCH] Proposed fix.
Comment 4 Pavel Feldman 2010-02-27 02:48:38 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/inspector/front-end/TextEditorHighlighter.js
Committed r55352
Comment 5 Jeff Johnson 2010-02-27 10:37:34 PST
The hanging actually seems a little worse on r55353 than it did on r55052.

Attaching a new sample.
Comment 6 Jeff Johnson 2010-02-27 10:38:29 PST
Created attachment 49684 [details]
Sample of Safari svn r55353
Comment 7 Pavel Feldman 2010-03-02 12:56:42 PST
(In reply to comment #6)
> Created an attachment (id=49684) [details]
> Sample of Safari svn r55353

Couple of observations:
1) Resource panel is now getting constant updates on the youtube's videoplayback resource. It repaints resource panel even when resource is being viewed. Should be easy to fix
2) I can see that on 4.0.4 scrolling also prevents movie from playing smoothly. It is not as bad as on ToT though.
3) As in sample attached, timeline shows me that most of the time is spent recalculating the styles. We just need to optimize our styles a lot and remove complex rules from them.
Comment 8 WebKit Commit Bot 2010-03-05 14:03:56 PST
Comment on attachment 49635 [details]
[PATCH] Proposed fix.

Cleared Timothy Hatcher's review+ from obsolete attachment 49635 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Comment 9 Rob Colburn 2012-05-09 09:27:23 PDT
This is ticket is marked REOPENED, but should be marked CLOSED/FIXED.
See:
Comment #8 From WebKit Commit Bot 2010-03-05 14:03:56 PST
Comment 10 Jeff Johnson 2012-05-09 09:39:20 PDT
(In reply to comment #9)
> This is ticket is marked REOPENED, but should be marked CLOSED/FIXED.
> See:
> Comment #8 From WebKit Commit Bot 2010-03-05 14:03:56 PST

Why should it be marked closed/fixed? It was not in fact fixed.
Comment 11 Rob Colburn 2012-05-09 10:46:36 PDT
Apologies, that statement was a bit strong.

I ran the test case you provided on all of the WebKits I have installed (including OS 10.6.2/Safari 5.1.5) and did not notice degraded performance while scrolling.

I had hoped that, given the age of the bug, it had been resolved somewhere else.

Thanks for verifying that the issue is still occurring.
Comment 12 Jeff Johnson 2012-05-09 11:11:08 PDT
(In reply to comment #11)
> Apologies, that statement was a bit strong.
> 
> I ran the test case you provided on all of the WebKits I have installed (including OS 10.6.2/Safari 5.1.5) and did not notice degraded performance while scrolling.
> 
> I had hoped that, given the age of the bug, it had been resolved somewhere else.
> 
> Thanks for verifying that the issue is still occurring.

Ah. I didn't verify that the issue is still occurring. You only mentioned the old commit bot comment, which didn't seem to give a reason for closing the bug.

If you've tested it and can no longer reproduce, then it may have been fixed. It should be noted, though, that this was mainly an issue in Debug builds rather than Release builds.