Bug 111117

Summary: REGRESSION(r144318) 1-7% perf. regression on SVG/SvgHitTesting
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, esprehn+autocc, hyatt, ojan.autocc, ojan, pdr, schenney, simon.fraser, WebkitBugTracker, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch kling: review+

Comment 1 Dave Hyatt 2013-02-28 15:38:01 PST
Looking into it. Will take me a bit to get a good build to profile with. I eyeballed the code and really don't see any explanation for it.
Comment 2 Dave Hyatt 2013-02-28 19:51:30 PST
I think this is just because of allocating the Vector of LayerFragments to be way too big. Narrowing it to a size of 1 seems to get the bulk of the time back. Patch coming soon.
Comment 3 Dave Hyatt 2013-03-01 08:02:58 PST
Created attachment 190969 [details]
Patch
Comment 4 Andreas Kling 2013-03-01 08:20:16 PST
Comment on attachment 190969 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=190969&action=review

r=me

> Source/WebCore/ChangeLog:7
> +        Make sure the allocated vector has a capacity of 1, since that is
> +        far and away the most common case.

You could go higher than 1 if you wanted to, since these are always on the stack anyway.
Comment 5 Stephen Chenney 2013-03-01 08:23:07 PST
Comment on attachment 190969 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=190969&action=review

> Source/WebCore/rendering/RenderFlowThread.h:43
> +typedef Vector<LayerFragment, 1> LayerFragments;

I presume that all the compilers can correctly handle the multiple identical declarations of LayerFragments that will occur when this header and RenderLayer.h are included in the same source file. To be safe, let's let it run through EWS on all platforms first.
Comment 6 Dave Hyatt 2013-03-01 12:48:27 PST
Fixed in r144484.
Comment 7 Dave Hyatt 2013-03-01 12:48:51 PST
I believe this was the cause of the slowdown. We can re-open if this isn't good enough.