Closed Bug 1853720 Opened 9 months ago Closed 9 months ago

Add a profiler label variant that does nothing if the profiler isn't running

Categories

(Core :: Gecko Profiler, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

(Whiteboard: [sp3])

Attachments

(2 files, 1 obsolete file)

On Speedometer3, even with the profiler disabled, 1.4% of the innerHTML setter is spent pushing and popping profiler labels for the frame constructor:

https://share.firefox.dev/48m13lm 42702 samples in innerHTML overall
https://share.firefox.dev/48dL34R 606 samples in AutoProfilerLabel code

These labels use the AUTO_PROFILER_LABEL macro. I think it would make sense to add an AUTO_PROFILER_LABEL_HOT macro which checks whether the profiler is running before it pushes the label.

The overhead is showing up in Speedometer 3, especially in the innerHTML setter
when it calls into the frame constructor.

Full breakdown of callers across sp3 is here: https://share.firefox.dev/3rfckTG

Time spent in AutoProfilerLabel during TodoMVC-jQuery innerHTML:
Before: https://share.firefox.dev/3Znlydp 378 sampes
After: https://share.firefox.dev/45VdVgr 71 samples

Depends on D188486

This probably doesn't tell the compiler anything it doesn't already know from PGO,
but it shouldn't hurt either.

Depends on D188487

Attachment #9353729 - Attachment is obsolete: true
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/08832aa3ba61
Inline-away AutoProfilerLabel::Push. r=aabh,profiler-reviewers
https://hg.mozilla.org/integration/autoland/rev/446af5901170
Add a "hot" variant of AUTO_PROFILER_LABEL, for lower overhead when the profiler is disabled. r=aabh,profiler-reviewers
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
Regressions: 1855661
Duplicate of this bug: 1832025
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: