Closed Bug 1777540 Opened 2 years ago Closed 2 years ago

LUL initialisation: inline `CmpExtentsByOffsetLE` so as to speed up sorting of `SecMap::mExtents`

Categories

(Core :: Gecko Profiler, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: jseward, Assigned: jseward)

References

Details

Attachments

(1 file)

After parsing Dwarf unwind info, the resulting mExtents array must be sorted
by start address. This forms a significant part of the overall unwind-info
reading costs.

This is done by calling std::sort. Unfortunately the way it is coded, the
comparison function is not inlined, which results in 91 million calls to it
when reading info up to and including for libxul.so.

This small patch turns it into a closure, which is inlined. For (performance)
safety, Extent::offset() is marked inline too.

On an Intel Core i5 1135G7 at circa 4 GHz, this reduces the Dwarf read time
from 0.42 seconds (after bug 1754932 has landed) to 0.35 seconds. Insn count
falls from 5630 million to 4775 million.

Severity: -- → N/A
Priority: -- → P3

After parsing Dwarf unwind info, the resulting mExtents array must be sorted
by start address. This forms a significant part of the overall unwind-info
reading cost.

This is done by calling std::sort. Unfortunately the way it is coded, the
comparison function is not inlined, which results in 91 million calls to it
when reading info up to and including for libxul.so.

This small patch turns it into a closure, which is inlined. For (performance)
safety, Extent::offset() is marked inline too.

On an Intel Core i5 1135G7 at circa 4 GHz, this reduces the Dwarf read time
from 0.42 seconds (after bug 1754932 has landed) to 0.35 seconds. Insn count
falls from 5630 million to 4775 million.

Blocks: 1777949
Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fa36ef26ae24 LUL initialisation: inline `CmpExtentsByOffsetLE` so as to speed up sorting of `SecMap::mExtents`. r=mstange.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: