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 46516
Use WTF::StringHasher for hashing MappedAttributeKey
https://bugs.webkit.org/show_bug.cgi?id=46516
Summary
Use WTF::StringHasher for hashing MappedAttributeKey
Patrick R. Gansterer
Reported
2010-09-24 14:41:01 PDT
see patch
Attachments
Patch
(3.11 KB, patch)
2010-09-24 14:43 PDT
,
Patrick R. Gansterer
no flags
Details
Formatted Diff
Diff
Patch
(3.10 KB, patch)
2010-09-27 00:36 PDT
,
Patrick R. Gansterer
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Patrick R. Gansterer
Comment 1
2010-09-24 14:43:02 PDT
Created
attachment 68753
[details]
Patch
Adam Barth
Comment 2
2010-09-26 21:39:55 PDT
Comment on
attachment 68753
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=68753&action=review
Do we want to run any performance tests to make sure we're not regressing here?
> WebCore/dom/StyledElement.cpp:-456 > - // This avoids ever returning a hash code of 0, since that is used to > - // signal "hash not computed yet", using a value that is likely to be > - // effectively the same as 0 when the low bits are masked > - if (hash == 0) > - hash = 0x80000000;
Does StringHasher respect this?
Patrick R. Gansterer
Comment 3
2010-09-26 23:53:52 PDT
(In reply to
comment #2
)
> (From update of
attachment 68753
[details]
) > Do we want to run any performance tests to make sure we're not regressing here?
StringHasher has only inline methods. The only real difference is the "pendingCharacter" (
http://trac.webkit.org/browser/trunk/JavaScriptCore/wtf/StringHashFunctions.h?rev=68369#L66
), but a intelligent compiler should be able optimize it away.
> > WebCore/dom/StyledElement.cpp:-456 > > - // This avoids ever returning a hash code of 0, since that is used to > > - // signal "hash not computed yet", using a value that is likely to be > > - // effectively the same as 0 when the low bits are masked > > - if (hash == 0) > > - hash = 0x80000000; > > Does StringHasher respect this?
StringHasher uses 0x40000000 instead (
http://trac.webkit.org/browser/trunk/JavaScriptCore/wtf/StringHashFunctions.h?rev=68369#L85
), but this shoudn't make a difference, because only "not null" is relevant.
Patrick R. Gansterer
Comment 4
2010-09-27 00:36:33 PDT
Created
attachment 68885
[details]
Patch Fixed copy/paste failure:
> COMPILE_ASSERT(sizeof(key.name) == 4 || sizeof(key.name) == 8, key_name_size); > COMPILE_ASSERT(sizeof(key.value) == 4 || sizeof(key.value) == 8, key_name_size);
Eric Seidel (no email)
Comment 5
2010-09-28 03:19:24 PDT
Comment on
attachment 68753
[details]
Patch Cleared Adam Barth's review+ from obsolete
attachment 68753
[details]
so that this bug does not appear in
http://webkit.org/pending-commit
.
Patrick R. Gansterer
Comment 6
2010-10-09 02:55:59 PDT
(In reply to
comment #2
)
> (From update of
attachment 68753
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=68753&action=review
> > Do we want to run any performance tests to make sure we're not regressing here?
I now run WebCore/benchmarks/parser/html-parser.html to check the difference: BEFORE PATCH: avg 4039.95 stdev 28.554290395665586 avg 4042.90 stdev 26.95904300972125 avg 4054.45 stdev 35.382870149268555 avg 4060.05 stdev 41.9147647017134 AFTER PATCH: avg 4044.30 stdev 34.20833231831099 avg 4055.15 stdev 28.320090042229737 avg 4055.40 stdev 29.014479144041164 avg 4062.60 stdev 39.329886854655456 Is the difference within the measuring tolerance?
Adam Barth
Comment 7
2010-10-09 08:12:16 PDT
> Is the difference within the measuring tolerance?
Yep. Thanks.
WebKit Commit Bot
Comment 8
2010-10-09 08:32:18 PDT
Comment on
attachment 68885
[details]
Patch Clearing flags on attachment: 68885 Committed
r69449
: <
http://trac.webkit.org/changeset/69449
>
WebKit Commit Bot
Comment 9
2010-10-09 08:32:23 PDT
All reviewed patches have been landed. Closing bug.
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