Bug 46044 - Gradient: Pre-reserve space for 2 color stops
Summary: Gradient: Pre-reserve space for 2 color stops
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Performance
Depends on:
Blocks:
 
Reported: 2010-09-18 17:05 PDT by Andreas Kling
Modified: 2010-09-18 17:23 PDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (1.14 KB, patch)
2010-09-18 17:06 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2010-09-18 17:05:45 PDT
Most gradients have only 2 color stops. We can avoid growing the Vector<ColorStop> dynamically in the common case by using an inlineCapacity of 2.

This yields a 0.4% speedup on Parcycle <http://www.mrspeaker.net/dev/parcycle/>
Comment 1 Andreas Kling 2010-09-18 17:06:54 PDT
Created attachment 68019 [details]
Proposed patch
Comment 2 Oliver Hunt 2010-09-18 17:18:05 PDT
Comment on attachment 68019 [details]
Proposed patch

r=me, i suspect this will actually save memory in the common case
Comment 3 Andreas Kling 2010-09-18 17:23:40 PDT
Comment on attachment 68019 [details]
Proposed patch

Clearing flags on attachment: 68019

Committed r67801: <http://trac.webkit.org/changeset/67801>
Comment 4 Andreas Kling 2010-09-18 17:23:50 PDT
All reviewed patches have been landed.  Closing bug.