WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 80707
Presentation attribute cache
https://bugs.webkit.org/show_bug.cgi?id=80707
Summary
Presentation attribute cache
Antti Koivisto
Reported
2012-03-09 09:58:50 PST
It is common for the same presentation attribute values repeat. We should introduce a cache that uses presentation attribute names and values as key. This will help to avoid repeated parsing of the same attribute values, reduce memory consumption and speed up the style resolve .
Attachments
patch
(7.57 KB, patch)
2012-03-09 10:20 PST
,
Antti Koivisto
webkit-ews
: commit-queue-
Details
Formatted Diff
Diff
try to silence the gcc warning, implement some comments
(7.60 KB, patch)
2012-03-09 10:58 PST
,
Antti Koivisto
kling
: review+
webkit.review.bot
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2012-03-09 10:20:25 PST
Created
attachment 131054
[details]
patch
Early Warning System Bot
Comment 2
2012-03-09 10:30:04 PST
Comment on
attachment 131054
[details]
patch
Attachment 131054
[details]
did not pass qt-wk2-ews (qt): Output:
http://queues.webkit.org/results/11898650
Early Warning System Bot
Comment 3
2012-03-09 10:34:31 PST
Comment on
attachment 131054
[details]
patch
Attachment 131054
[details]
did not pass qt-ews (qt): Output:
http://queues.webkit.org/results/11906670
WebKit Review Bot
Comment 4
2012-03-09 10:34:41 PST
Comment on
attachment 131054
[details]
patch
Attachment 131054
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/11904652
Andreas Kling
Comment 5
2012-03-09 10:43:34 PST
Comment on
attachment 131054
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=131054&action=review
> Source/WebCore/dom/StyledElement.cpp:73 > + static PresentationAttributeCache* cache = new PresentationAttributeCache(); > + return *cache;
Needs more common WebKit patterns: DEFINE_STATIC_LOCAL(PresentationAttributeCache, cache, ()); return cache;
> Source/WebCore/dom/StyledElement.cpp:204 > + if (!attribute->namespaceURI().isNull()) > + return;
Perhaps this could be an assertion instead?
> Source/WebCore/dom/StyledElement.cpp:236 > + PresentationAttributeCache::iterator cacheIterator; > + if (cacheHash) { > + cacheIterator = presentationAttributeCache().add(cacheHash, nullptr).first;
We could grab the PresentationAttributeCacheEntry* instead of holding on to a PresentationAttributeCache::iterator here to make the following code a little prettier.
Antti Koivisto
Comment 6
2012-03-09 10:58:50 PST
Created
attachment 131063
[details]
try to silence the gcc warning, implement some comments
Antti Koivisto
Comment 7
2012-03-09 11:01:22 PST
(In reply to
comment #5
)
> We could grab the PresentationAttributeCacheEntry* instead of holding on to a PresentationAttributeCache::iterator here to make the following code a little prettier.
I need the iterator to avoid the second hash lookup in case of insertion.
Andreas Kling
Comment 8
2012-03-09 11:27:50 PST
Comment on
attachment 131063
[details]
try to silence the gcc warning, implement some comments r=me. I wonder if we can make this cache case-insensitive. That should provide a solid increase in sharing on Y2K content.
WebKit Review Bot
Comment 9
2012-03-09 11:57:38 PST
Comment on
attachment 131063
[details]
try to silence the gcc warning, implement some comments
Attachment 131063
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/11894738
New failing tests: fast/forms/input-type-change.html
Antti Koivisto
Comment 10
2012-03-09 12:16:32 PST
http://trac.webkit.org/changeset/110316
(with a fix for the failing test)
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug