Bug 115581 - Remove CSS selector profiler branches from ElementRuleCollector loop.
Summary: Remove CSS selector profiler branches from ElementRuleCollector loop.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: Performance
Depends on:
Blocks:
 
Reported: 2013-05-03 20:45 PDT by Andreas Kling
Modified: 2013-05-04 08:02 PDT (History)
7 users (show)

See Also:


Attachments
Patch (5.11 KB, patch)
2013-05-03 20:46 PDT, 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-05-03 20:45:54 PDT
Remove CSS selector profiler branches from ElementRuleCollector loop.
Comment 1 Andreas Kling 2013-05-03 20:46:26 PDT
Created attachment 200514 [details]
Patch
Comment 2 Antti Koivisto 2013-05-03 20:53:54 PDT
Comment on attachment 200514 [details]
Patch

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

> Source/WebCore/css/ElementRuleCollector.cpp:409
> +    if (InspectorInstrumentation::hasFrontends())
> +        doCollectMatchingRulesForList<true>(rules, matchRequest, ruleRange);
> +    else
> +        doCollectMatchingRulesForList<false>(rules, matchRequest, ruleRange);

Please use early return for the exceptional path. UNLIKELY might be good too.
Comment 3 Andreas Kling 2013-05-04 08:02:39 PDT
Committed r149557: <http://trac.webkit.org/changeset/149557>