Summary: | Implement a cache for CSSStyleRule::selectorText() | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alexander Pavlov (apavlov) <apavlov> | ||||||
Component: | CSS | Assignee: | Alexander Pavlov (apavlov) <apavlov> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | macpherson, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 74004 | ||||||||
Attachments: |
|
Description
Alexander Pavlov (apavlov)
2011-12-12 00:56:58 PST
Created attachment 118754 [details]
Patch
Created attachment 118782 [details]
[PATCH] ChangeLog entry augmented
Comment on attachment 118782 [details] [PATCH] ChangeLog entry augmented View in context: https://bugs.webkit.org/attachment.cgi?id=118782&action=review r=me, but please inline cleanup() before landing. > Source/WebCore/css/CSSStyleRule.cpp:51 > + cleanup(); I'd rather we inline cleanup() here to avoid introducing a perf regression (however tiny) in document teardown. > Source/WebCore/css/CSSStyleRule.cpp:126 > + if (m_hasCachedSelectorText) { > + ASSERT(selectorTextCache().contains(this)); > + selectorTextCache().remove(this); > + m_hasCachedSelectorText = false; > + } > + > if (this->selectorText() == oldSelectorText) > return; We could factor this differently to reduce hash map churn (the remove() is always followed by a set().) Committed r102584: <http://trac.webkit.org/changeset/102584> |