WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
205774
[WebCore] Shrink sizeof(RuleFeature)
https://bugs.webkit.org/show_bug.cgi?id=205774
Summary
[WebCore] Shrink sizeof(RuleFeature)
Yusuke Suzuki
Reported
2020-01-04 19:08:19 PST
[WebCore] Shrink sizeof(RuleFeature)
Attachments
Patch
(8.70 KB, patch)
2020-01-04 19:11 PST
,
Yusuke Suzuki
dino
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2020-01-04 19:11:59 PST
Created
attachment 386779
[details]
Patch
Yusuke Suzuki
Comment 2
2020-01-04 19:15:22 PST
Comment on
attachment 386779
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=386779&action=review
> Source/WebCore/style/RuleFeature.h:42 > struct RuleFeature {
I'm still thinking about further reduction of size. 1. matchElement is used in some specific places. Most of RuleFeature does not have this. 2. selectorListIndex is only used for CSSJIT. I think we could remove it, move it to other place, or recalculate it. 3. We could use PackedRefPtr<const StyleRule>, which is 6 byte. If we do that, we could make RuleFeature, struct RuleFeature { PackedRefPtr<const StyleRule> styleRule; uint16_t selectorIndex; }; Then, sizeof(RuleFeature) is 8 bytes. For now, I postpone this.
Antti Koivisto
Comment 3
2020-01-05 14:55:53 PST
Comment on
attachment 386779
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=386779&action=review
> Source/WebCore/ChangeLog:8 > + We noticed that Vector<RuleFeature> is frequently allocated and kept. While sizeof(RuleFeature) is 32,
What sort of memory usage did you see here in the worst cases?
Yusuke Suzuki
Comment 4
2020-01-06 10:56:11 PST
Comment on
attachment 386779
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=386779&action=review
>> Source/WebCore/ChangeLog:8 >> + We noticed that Vector<RuleFeature> is frequently allocated and kept. While sizeof(RuleFeature) is 32, > > What sort of memory usage did you see here in the worst cases?
In Gmail, it is using 100KB + 56KB + ...
Yusuke Suzuki
Comment 5
2020-01-06 10:59:43 PST
Committed
r254065
: <
https://trac.webkit.org/changeset/254065
>
Radar WebKit Bug Importer
Comment 6
2020-01-06 11:00:32 PST
<
rdar://problem/58347222
>
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