Closed Bug 1665258 Opened 4 years ago Closed 4 years ago

Shrink some structs by reordering fields

Categories

(Core :: General, task)

task

Tracking

()

RESOLVED FIXED
83 Branch
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.

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.

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

This reduces the size of spoofingKeyboardInfoTable from 4 KiB to 3 KiB,
saving of memory 1 KiB per process.

Depends on D90345

Whiteboard: [overhead:1.5k]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: