Bug 205774

Summary: [WebCore] Shrink sizeof(RuleFeature)
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, dino, koivisto, sam, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch dino: review+

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+
Yusuke Suzuki
Comment 1 2020-01-04 19:11:59 PST
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
Radar WebKit Bug Importer
Comment 6 2020-01-06 11:00:32 PST
Note You need to log in before you can comment on or make changes to this bug.