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
Pavel Feldman
2009-11-12 13:56:53 PST
Created attachment 43096 [details]
[PATCH] fixes.
There are few lines removed in AbstractTimelinePanel. I don't understand why they were there. Any clues?
> + 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?
(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. Created attachment 43102 [details]
[PATCH] Updating removeStyleClass as well.
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 |