[WebCore] Shrink sizeof(RuleFeature)
Created attachment 386779 [details] Patch
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.
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?
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 + ...
Committed r254065: <https://trac.webkit.org/changeset/254065>
<rdar://problem/58347222>