sitespeedio / sitespeedio/browsertime

Await for the gecko profiler start instead of adding a synthetic delay

Open
#1,857 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
652
Forks
141
Avg merge
3h 56m
Merged PRs (30d)
5

Description

Feature/improvement

Currently browsertime adds a delay after the gecko profiler start command:
https://github.com/sitespeedio/browsertime/blob/79e9b0e1f72c3005641b1131173cdaaf24f93a51/lib/firefox/geckoProfiler.js#L89-L90
This was because previously we didn't have a way to properly await for the profiler start since all the processes start the profiler individually. But this year, with the Bug 1668867, we've started to return a Promise instead from the Services.profiler.StartProfiler API and it resolves when all the processes start profiling. This way we can start the profiler and await until it's ready without needing an additional settle delay.

Here's the profiler start command in browsertime:
https://github.com/sitespeedio/browsertime/blob/79e9b0e1f72c3005641b1131173cdaaf24f93a51/lib/firefox/geckoProfiler.js#L74-L77

Here's an example in our tests: https://searchfox.org/mozilla-central/rev/0a2eba79c24300ce0539f91c1bebac2e75264e58/tools/profiler/tests/xpcshell/test_active_configuration.js#24-30

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/firefox/geckoProfiler.js at the profiler start command and the following delay around lines 74-90. Compare the implementation with the linked Mozilla xpcshell test for Services.profiler.StartProfiler. Done means the profiler startup is awaited and the synthetic settle delay is no longer needed, with relevant tests passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.