Closed
Bug 1249174
Opened 9 years ago
Closed 9 years ago
Shrink XPT info some more
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
(Whiteboard: [MemShrink:P2])
Attachments
(8 files, 3 obsolete files)
3.50 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
2.39 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
4.99 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
1.52 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
8.34 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
18.18 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
7.31 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
5.96 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
I have a couple of patches that shrink the size of the XPT info a bit.
Assignee | ||
Comment 1•9 years ago
|
||
PTTypeDescriptor::argnum2 is unused. Removing it reduces
sizeof(XPTTypeDescriptor) from 6 bytes to 4 bytes, which reduces the
"xpti-working-set" measurement by 80 KiB (measured on 64-bit).
Attachment #8720589 -
Flags: review?(khuey)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•9 years ago
|
||
This reduces "xpti-working-set" by another 16 KiB on 64-bit.
Attachment #8720622 -
Flags: review?(khuey)
Assignee | ||
Comment 3•9 years ago
|
||
Removing it reduces the "xpti-working-set" measurement by 16 KiB (measured on
64-bit).
Attachment #8720645 -
Flags: review?(khuey)
Assignee | ||
Comment 4•9 years ago
|
||
This requires merging XPT_DoHeaderPrologue() and XPT_DoHeader(), which is
straightforward.
This reduces "xpti-working-set" by 16 KiB on 64-bit platforms.
Attachment #8721075 -
Flags: review?(khuey)
Assignee | ||
Comment 5•9 years ago
|
||
Attachment #8721078 -
Flags: review?(khuey)
Assignee | ||
Comment 6•9 years ago
|
||
With careful layout we can reduce sizeof(XPTTypeDescriptor) from 4 to 3, which
also reduces sizeof(XPTParamDescriptor) from 6 to 4. This reduces
"xpti-working-set" by 16 KiB.
The union-of-structs also improves readability by making it clearer exactly
which fields are used for which types.
Attachment #8721825 -
Flags: review?(khuey)
Assignee | ||
Comment 7•9 years ago
|
||
This patch:
- Removes XPTArena's ability to support any alignment.
- Hardwires two sub-arenas into XPTArena, one with alignment of 8 and one with
alignment of 1.
- Uses the first sub-arena for most allocations and the second sub-arena for C
string allocations.
These changes reduce "xpti-working-set" by 56 KiB.
The patch also removes the XPT_MALLOC macro in favour of an XPT_CALLOC one, to
make clearer that the result is always zeroed.
Attachment #8721848 -
Flags: review?(khuey)
Assignee | ||
Comment 8•9 years ago
|
||
(A tweaked version of the previous patch.)
Attachment #8721860 -
Flags: review?(khuey)
Assignee | ||
Updated•9 years ago
|
Attachment #8721848 -
Attachment is obsolete: true
Attachment #8721848 -
Flags: review?(khuey)
Assignee | ||
Comment 9•9 years ago
|
||
PTInterfaceDescriptor::num_additional_types can easily fit in 8 bits -- in
practice it doesn't exceed 20, and there's already a check in DoTypeDescriptor
that it doesn't exceed 255. This patch shrinks it and moves that check into
XPT_InterfaceDescriptorAddTypes() so that any overflow would be detected more
reliably.
On 64-bit platforms this reduces sizeof(XPTInterfaceDescriptor) from 40 to 32
and correspondingly reduces "xpti-working-set" by 16 KiB.
The patch also changes XPT_InterfaceDescriptorAddTypes() into a local function,
because it's defined and only used in xpt_struct.cpp.
Attachment #8721871 -
Flags: review?(khuey)
Assignee | ||
Comment 10•9 years ago
|
||
The eight patches reduce "xpti-working-set" (on 64-bit platforms) from 1184 KiB to 968 KiB -- a reduction of 216 KiB -- and I'm out of ideas for now.
Assignee | ||
Comment 11•9 years ago
|
||
(I tweaked a comment.)
Attachment #8722094 -
Flags: review?(khuey)
Assignee | ||
Updated•9 years ago
|
Attachment #8721075 -
Attachment is obsolete: true
Attachment #8721075 -
Flags: review?(khuey)
Assignee | ||
Comment 12•9 years ago
|
||
(I tweaked a comment.)
Attachment #8722095 -
Flags: review?(khuey)
Assignee | ||
Updated•9 years ago
|
Attachment #8721871 -
Attachment is obsolete: true
Attachment #8721871 -
Flags: review?(khuey)
Assignee | ||
Comment 13•9 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #10)
> The eight patches reduce "xpti-working-set" (on 64-bit platforms) from 1184
> KiB to 968 KiB -- a reduction of 216 KiB -- and I'm out of ideas for now.
I measured on 32-bit as well: 936 KiB drops to 776 KiB, a 160 KiB reduction.
Updated•9 years ago
|
Whiteboard: [MemShrink] → [MemShrink:P2]
Attachment #8720589 -
Flags: review?(khuey) → review+
Attachment #8720622 -
Flags: review?(khuey) → review+
Attachment #8720645 -
Flags: review?(khuey) → review+
Attachment #8722094 -
Flags: review?(khuey) → review+
Attachment #8721078 -
Flags: review?(khuey) → review+
Attachment #8721825 -
Flags: review?(khuey) → review+
Attachment #8721860 -
Flags: review?(khuey) → review+
Attachment #8722095 -
Flags: review?(khuey) → review+
Assignee | ||
Comment 14•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/fa81f18d5093d47064913e1e7fb6c54d03419df0
Bug 1249174 (part 7) - Only define XPTArena::name if XPT_ARENA_LOGGING is defined. r=khuey.
Assignee | ||
Comment 15•9 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #14)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/
> fa81f18d5093d47064913e1e7fb6c54d03419df0
> Bug 1249174 (part 7) - Only define XPTArena::name if XPT_ARENA_LOGGING is
> defined. r=khuey.
Whoops. That was meant to be part of bug 1248534, which blocks this one, but I got the bug number wrong. No matter, I'll rename the part 7 above ("Avoid wasted space around XPT strings") to 7.5 to avoid further confusion.
Comment 16•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Assignee | ||
Comment 17•9 years ago
|
||
More patches to land here.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 18•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/639ee2cb781c339fe86fd1fed4122b809d2a1fc1
Bug 1249174 (part 1) - Don't store the unused XPTTypeDescriptorTags::argnum2 field in memory. r=khuey.
https://hg.mozilla.org/integration/mozilla-inbound/rev/d8db031fc4a77c85088755f1919d9c4e11b82fed
Bug 1249174 (part 2) - Shrink xptiInterfaceEntry by reordering its fields. r=khuey.
https://hg.mozilla.org/integration/mozilla-inbound/rev/df54281b08634341fb1a421b9753718966c45fe7
Bug 1249174 (part 3) - Don't store the unused XPTInterfaceDirectoryEntry::name_space field in memory. r=khuey.
https://hg.mozilla.org/integration/mozilla-inbound/rev/f4296d24c1f357f6b45acd50e76ea056afe3e2cc
Bug 1249174 (part 4) - Don't store unused XPTHeader fields in memory. r=khuey.
https://hg.mozilla.org/integration/mozilla-inbound/rev/69bc807d8b8a36604f313626071fa4d624e8605d
Bug 1249174 (part 5) - Remove the useless BLK_HDR::size field. r=khuey.
https://hg.mozilla.org/integration/mozilla-inbound/rev/6a5f30460690b5089f648e8a38eed27d52a8d597
Bug 1249174 (part 6) - Shrink XPTTypeDescriptor. r=khuey.
https://hg.mozilla.org/integration/mozilla-inbound/rev/ca3090cb8e36dd77612ffdc84cd8953897ff72fd
Bug 1249174 (part 7.5) - Avoid wasted space around XPT strings. r=khuey.
https://hg.mozilla.org/integration/mozilla-inbound/rev/b5d5f42ed917c073f2edaeb01e97f88bdaa4d1fd
Bug 1249174 (part 8) - Shrink XPTInterfaceDescriptor. r=khuey.
Comment 19•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/639ee2cb781c
https://hg.mozilla.org/mozilla-central/rev/d8db031fc4a7
https://hg.mozilla.org/mozilla-central/rev/df54281b0863
https://hg.mozilla.org/mozilla-central/rev/f4296d24c1f3
https://hg.mozilla.org/mozilla-central/rev/69bc807d8b8a
https://hg.mozilla.org/mozilla-central/rev/6a5f30460690
https://hg.mozilla.org/mozilla-central/rev/ca3090cb8e36
https://hg.mozilla.org/mozilla-central/rev/b5d5f42ed917
Status: REOPENED → RESOLVED
Closed: 9 years ago → 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•