Bug 1400100 - Shrink css::ImageValue. r=heycam. draft
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 15 Sep 2017 14:37:12 +1000
changeset 666128 390a79a389500eae481fafa839b74b08b9c0618b
parent 666127 ae39864562c6048fdc2950c5dfedb48e247c3300
child 731981 6a280a742cfedfb890bb028155318584bcc910f8
push id80280
push usernnethercote@mozilla.com
push dateMon, 18 Sep 2017 00:04:45 +0000
reviewersheycam
bugs1400100
milestone57.0a1
Bug 1400100 - Shrink css::ImageValue. r=heycam. This reduces sizeof(ImageValue) from 104 to 96. When heap-allocated, this moves it from the 112 byte bin to the 96 byte bin. Loading gmail with Stylo, there are about 11,500 ImageValues on the heap, so this saves about 184,000 bytes. MozReview-Commit-ID: JLe2cJ54IlL
layout/style/nsCSSValue.h
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -262,23 +262,23 @@ struct ImageValue final : public URLValu
 
   void Initialize(nsIDocument* aDocument);
 
   // XXXheycam We should have our own SizeOfIncludingThis method.
 
 protected:
   ~ImageValue();
 
+private:
+  bool mLoadedImage = false;
+
 public:
   // Inherit Equals from URLValueData
 
   nsRefPtrHashtable<nsPtrHashKey<nsIDocument>, imgRequestProxy> mRequests;
-
-private:
-  bool mLoadedImage = false;
 };
 
 struct GridNamedArea {
   nsString mName;
   uint32_t mColumnStart;
   uint32_t mColumnEnd;
   uint32_t mRowStart;
   uint32_t mRowEnd;