Closed Bug 1377916 Opened 7 years ago Closed 7 years ago

Include DOM workers in startup profiles

Categories

(Core :: Gecko Profiler, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: florian, Assigned: florian)

Details

Attachments

(1 file)

I've been puzzled for a while by non-jank areas on the main thread on warm startup profiles from the quantum reference hardware.

Cold startup doesn't reproduce.

I've noticed that I can reproduce this behavior on my Mac local build if I package it and run it with -purgecaches. I suspect putting all .js files in omni.jar but skipping some startup caches gives my macbook (with a fast ssd) I/O timings that are similar to what I get on Windows on the reference hardware when everything is in cache.
On my Mac local build, I've profiled startup with all threads, by emptying the filter area at http://searchfox.org/mozilla-central/rev/5bb6dfcb3355a912c20383578bc435c1d4ecf575/tools/profiler/core/platform.cpp#2124

Unfortunately the profile I get (https://perfht.ml/2u8fl5T) isn't fully helpful, as the stacks contain a lot of garbage for native code (I think this is because the binaries are stripped when packaging). However, this is enough to see that the white areas where the main thread is idle before first paint roughly match 'DOM Worker' threads using OS.File.

I suspect we have a problem here with several threads simultaneously waiting for locks to access cached resource:// files, but without correct symbols it's difficult to be sure of what's going on.

Given that this is a significant portion of startup that went unnoticed until now, I think it would make sense to include DOM workers in startup profiles by default (ideally we would like the set of threads to be configurable for startup profiles, ie. bug 873915, but even then, I think profiling by default the threads that can run scripts makes sense)
Attached patch PatchSplinter Review
Attachment #8883059 - Flags: review?(mstange)
Attachment #8883059 - Flags: review?(mstange) → review+
Pushed by florian@queze.net:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c41cf5b937f7
Include DOM workers in startup profiles, r=mstange.
https://hg.mozilla.org/mozilla-central/rev/c41cf5b937f7
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: