Bug 124338 - FontDescription copies should share families list, not duplicate it.
Summary: FontDescription copies should share families list, not duplicate it.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-14 01:36 PST by Andreas Kling
Modified: 2013-11-14 02:59 PST (History)
15 users (show)

See Also:


Attachments
Patch (6.09 KB, patch)
2013-11-14 01:38 PST, Andreas Kling
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2013-11-14 01:36:32 PST
Potential savings here. We have a looooot of FontDescription copies thanks to copy-on-write StyleInheritedData.
Comment 1 Andreas Kling 2013-11-14 01:38:08 PST
Created attachment 216909 [details]
Patch
Comment 2 Antti Koivisto 2013-11-14 01:58:33 PST
Comment on attachment 216909 [details]
Patch

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

> Source/WebCore/platform/graphics/FontDescription.h:235
> +inline bool FontDescription::hasEqualFamilies(const FontDescription& other) const
> +{
> +    if (m_families.data() == other.m_families.data())
> +        return true;
> +    if (m_families.size() != other.m_families.size())
> +        return false;
> +    for (unsigned i = 0; i < m_families.size(); ++i) {
> +        if (m_families[i] != other.m_families[i])
> +            return false;
> +    }
> +    return true;
> +}

Seems more like this could be operator== or equals in RefCountedArray
Comment 3 Andreas Kling 2013-11-14 02:59:57 PST
Committed r159279: <http://trac.webkit.org/changeset/159279>