Closed Bug 1654576 Opened 4 years ago Closed 4 years ago

Ordering of the data members in nsPresContext results in wasted space

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

Details

Attachments

(1 file)

The fields in nsPresContext are somewhat disorderly, with the result that alignment requirements cause a bunch of extra padding to be included, and the object is bigger than it needs to be. By rearranging some declarations, we can noticeably reduce its size.

(It doesn't appear to me as though things have been deliberately ordered for efficient access or anything like that; looks more like just ad hoc growth.)

This reduces sizeof(nsPresContext) in my (opt) build on macOS from 568 to 544 bytes.

Depends on D84541

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1a45e9ea3c10
Reorder data members in nsPresContext for more efficient packing. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: