Shrink some structs by reordering fields
Categories
(Core :: General, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [overhead:1.5k])
Attachments
(3 files)
I looked through the "excessive padding" reports in a firefox-scan-build run. Most of them weren't interesting, involving structs like JSRuntime
that are very large (so the proportion of wasted space is small) and/or instantiated a small number of times.
But there were three ones worth fixing for some tiny wins.
![]() |
Assignee | |
Comment 1•4 years ago
|
||
Better field packing reduces it from 48 bytes to 40 bytes on 64-bit.
This reduces the memory used by each process by 336 bytes on 64-bit.
![]() |
Assignee | |
Comment 2•4 years ago
|
||
Better field packing reduces it from 48 bytes to 44 bytes on 64-bit.
This reduces the size of the text
section by 14,288 bytes, due to
gHistogramInfos
shrinking.
Depends on D90344
![]() |
Assignee | |
Comment 3•4 years ago
|
||
This reduces the size of spoofingKeyboardInfoTable
from 4 KiB to 3 KiB,
saving of memory 1 KiB per process.
Depends on D90345
Comment 6•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c8657e9dd191
https://hg.mozilla.org/mozilla-central/rev/b21c1c12747d
https://hg.mozilla.org/mozilla-central/rev/1f949d96cddd
Updated•4 years ago
|
Description
•