Bug 96315 - Reduce the number of treeScope queries when matching rules.
Summary: Reduce the number of treeScope queries when matching rules.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dimitri Glazkov (Google)
URL:
Keywords:
Depends on:
Blocks: 95664
  Show dependency treegraph
 
Reported: 2012-09-10 13:52 PDT by Dimitri Glazkov (Google)
Modified: 2012-09-10 17:01 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.20 KB, patch)
2012-09-10 13:57 PDT, Dimitri Glazkov (Google)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri Glazkov (Google) 2012-09-10 13:52:58 PDT
Reduce the number of treeScope queries when matching rules.
Comment 1 Dimitri Glazkov (Google) 2012-09-10 13:57:03 PDT
Created attachment 163202 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-09-10 14:27:29 PDT
Comment on attachment 163202 [details]
Patch

I assume this is a perf change. :)  Do we have any benchmarks which notice this?  It looks fine though.
Comment 3 Dimitri Glazkov (Google) 2012-09-10 14:30:11 PDT
I am still trying to get the benchmark set up running on my machine, but I'll be watching the perf results when this lands. Do you think it's worth promoting treeScope to a member of StyleResolver that's initialized once for styleForElement?
Comment 4 Eric Seidel (no email) 2012-09-10 14:34:03 PDT
The treeScope is part of the per-element state, which eventually needs to be ripped out of StyleResolver into a separate object. :)  But yes, it could be a member on that state, or on StyleResolver directly until then if you have benchmarks to show that it's important.
Comment 5 Dimitri Glazkov (Google) 2012-09-10 14:35:11 PDT
(In reply to comment #4)
> The treeScope is part of the per-element state, which eventually needs to be ripped out of StyleResolver into a separate object. :)

Did you not have a bug on this somewhere?
Comment 6 Eric Seidel (no email) 2012-09-10 14:47:48 PDT
https://bugs.webkit.org/show_bug.cgi?id=89879 is a meta bug I created.  I didn't create on specifically about splitting out the per-element state.
Comment 7 WebKit Review Bot 2012-09-10 16:26:13 PDT
Comment on attachment 163202 [details]
Patch

Clearing flags on attachment: 163202

Committed r128128: <http://trac.webkit.org/changeset/128128>
Comment 8 WebKit Review Bot 2012-09-10 16:26:16 PDT
All reviewed patches have been landed.  Closing bug.