Bug 31432

Summary: Web Inspector: profile timeline panel, fix obvious problems.
Product: WebKit Reporter: Pavel Feldman <pfeldman>
Component: Web Inspector (Deprecated)Assignee: Pavel Feldman <pfeldman>
Status: RESOLVED FIXED    
Severity: Normal CC: bweinstein, joepeck, rik, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] fixes.
none
[PATCH] Updating removeStyleClass as well. timothy: review+

Description Pavel Feldman 2009-11-12 13:56:53 PST
Start timeline for cnn.com load. Stop it in 30 seconds. Moving / resizing window is slow.
Comment 1 Pavel Feldman 2009-11-12 14:00:18 PST
Created attachment 43096 [details]
[PATCH] fixes.

There are few lines removed in AbstractTimelinePanel. I don't understand why they were there. Any clues?
Comment 2 Joseph Pecoraro 2009-11-12 14:30:51 PST
> +    var index = this.className.indexOf(className);
> +    if (index === -1)
> +        return false;
> +    var toTest = " " + this.className + " ";
> +    return toTest.indexOf(" " + className + " ", index) !== -1;

Why the changes to hasStyleClass? I assume that using indexOf is faster then checking a regular expression. If that is the case then this looks like a good idea. In your experience is the string concatenation that expensive that its worth the early check?
Comment 3 Pavel Feldman 2009-11-12 14:47:00 PST
(In reply to comment #2)
> > +    var index = this.className.indexOf(className);
> > +    if (index === -1)
> > +        return false;
> > +    var toTest = " " + this.className + " ";
> > +    return toTest.indexOf(" " + className + " ", index) !== -1;
> 
> Why the changes to hasStyleClass? I assume that using indexOf is faster then
> checking a regular expression. If that is the case then this looks like a good
> idea. In your experience is the string concatenation that expensive that its
> worth the early check?

As I understand it creates two more objects in VM heap. Given that GC is not (yet?) generational, it'll make subsequent gc more expensive.
Comment 4 Pavel Feldman 2009-11-12 14:47:42 PST
Created attachment 43102 [details]
[PATCH] Updating removeStyleClass as well.
Comment 5 Pavel Feldman 2009-11-12 15:07:38 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/inspector/front-end/AbstractTimelinePanel.js
	M	WebCore/inspector/front-end/TimelinePanel.js
	M	WebCore/inspector/front-end/utilities.js
Committed r50909