Closed Bug 1307500 Opened 8 years ago Closed 8 years ago

enhance string sharing between ipdl-generated MOZ_DIAGNOSTIC_ASSERT messages

Categories

(Core :: IPC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file)

For every protocol's RemoveManagee method, and every sub-protocol that
protocol manages, we generate:

  MOZ_DIAGNOSTIC_ASSERT(mManagedPSubProtcolChild.Contains(actor), "...");

which dumps strings into the binary like:

(mManagedPAsmJSCacheEntryChild).Contains(actor) (actor not managed by this!)
MOZ_RELEASE_ASSERT((mManagedPAsmJSCacheEntryChild).Contains(actor)) (actor not managed by this!)

The linker is capable of merging multiple strings together, but
including the sub-protocol in every assert expression effectively
defeats this linker optimization, resulting in ~40KB of unnecessary
strings.

We can improve this situation by taking a reference to the managee
container, and using that reference in the assertion expression.  All
the assertion expressions are identical, and the linker can perform the
expected string merging, for a savings of ~40KB.
A small improvement, but one I've been thinking about for a while.
Attachment #8797661 - Flags: review?(wmccloskey)
Attachment #8797661 - Flags: review?(wmccloskey) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9834b841d060
enhance string sharing between ipdl-generated MOZ_DIAGNOSTIC_ASSERT messages; r=billm
https://hg.mozilla.org/mozilla-central/rev/9834b841d060
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: