Bug 134258

Summary: [XHR] Realign bool members of XmlHttpRequest to reduce padding
Product: WebKit Reporter: Mahesh Kulkarni <maheshk>
Component: New BugsAssignee: Mahesh Kulkarni <maheshk>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bunhere, cdumez, commit-queue, gyuyoung.kim, laszlo.gombos, rbuis, sergio
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch bfulgham: review-

Mahesh Kulkarni
Reported 2014-06-24 11:51:06 PDT
[XHR] Realign bool members of XmlHttpRequest to reduce padding
Attachments
Patch (3.48 KB, patch)
2014-06-24 11:53 PDT, Mahesh Kulkarni
bfulgham: review-
Mahesh Kulkarni
Comment 1 2014-06-24 11:53:29 PDT
Laszlo Gombos
Comment 2 2014-06-24 17:35:00 PDT
+ Alexey
Alexey Proskuryakov
Comment 3 2014-06-24 21:47:43 PDT
I guess it's OK to do, but it also seems pretty pointless. Is there a measurable improvement on any test from this patch?
Mahesh Kulkarni
Comment 4 2014-06-26 08:43:17 PDT
(In reply to comment #3) > I guess it's OK to do, but it also seems pretty pointless. Is there a measurable improvement on any test from this patch? ap, with this minor optimization in realigning order of bool members, sizeof(xhr) is down by 16bytes (on 64bit machine. Also generally a good practice to move all small members towards the end of class). Though xhr aren't objects kept for long in memory, idea behind this patch to help readability and good practice (i.e Using bitfields/bitmask saves same amount of memory but effects code readability).
Brent Fulgham
Comment 5 2016-03-14 11:31:09 PDT
Comment on attachment 233723 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=233723&action=review This patch is too old to apply cleanly. However, I strongly agree with the code change. Could you please update this so that it applies against current sources? > Source/WebCore/xml/XMLHttpRequest.h:259 > bool m_responseCacheIsValid; If you are making this change, please use C++11 initialization.
Rob Buis
Comment 6 2019-02-15 12:01:56 PST
This is fixed using bitfields in ToT.
Note You need to log in before you can comment on or make changes to this bug.