Bug 102507 - StyleResolver: Optimize sharing candidate evaluation for elements with shared attribute data.
Summary: StyleResolver: Optimize sharing candidate evaluation for elements with shared...
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
Depends on:
Reported: 2012-11-16 07:25 PST by Andreas Kling
Modified: 2012-11-16 09:55 PST (History)
5 users (show)

See Also:

Patch (5.65 KB, patch)
2012-11-16 07:28 PST, Andreas Kling
koivisto: review+
Details | Formatted Diff | Diff
Patch for landing (5.70 KB, patch)
2012-11-16 08:07 PST, 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 2012-11-16 07:25:01 PST
We can avoid comparing a bunch of attributes if the two elements being evaluated for style sharing both share the same ElementAttributeData.
Comment 1 Andreas Kling 2012-11-16 07:28:30 PST
Created attachment 174680 [details]
Comment 2 Antti Koivisto 2012-11-16 07:32:10 PST
Comment on attachment 174680 [details]

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

> Source/WebCore/css/StyleResolver.cpp:1205
> +    // Optimization: Avoid pointless comparisons when the elements share the same attribute data.
> +    if (element->attributeData() != m_element->attributeData()) {
> +        if (element->fastGetAttribute(XMLNames::langAttr) != m_element->fastGetAttribute(XMLNames::langAttr))

Might be nice to factor the attribute specific tests to a function.
Comment 3 Andreas Kling 2012-11-16 08:07:43 PST
Created attachment 174686 [details]
Patch for landing
Comment 4 WebKit Review Bot 2012-11-16 09:55:03 PST
Comment on attachment 174686 [details]
Patch for landing

Clearing flags on attachment: 174686

Committed r134962: <http://trac.webkit.org/changeset/134962>
Comment 5 WebKit Review Bot 2012-11-16 09:55:06 PST
All reviewed patches have been landed.  Closing bug.