mozilla / browsertime

Your browser, your page, your scripts!
Apache License 2.0
5 stars 7 forks source link

Don't start pageload right after profiler is started #53

Open sefeng211 opened 4 years ago

sefeng211 commented 4 years ago

This is a profile I collected by using browsertime: https://perfht.ml/346daRd The problem is there's no gap between the empty buffer and the page starts to load.

I'd suggest we wait a second after this line https://github.com/mozilla/browsertime/blob/e37e3b0bfe2daa4dc0a099c640e557847c949abd/lib/firefox/webdriver/firefoxDelegate.js#L73

ncalexan commented 4 years ago

This is a profile I collected by using browsertime: https://perfht.ml/346daRd The problem is there's no gap between the empty buffer and the page starts to load.

Why is a gap necessary? Is starting the Gecko profiler not synchronous, meaning that after starting (via privileged JS, say) we still need to wait for it to be ready?

I'd suggest we wait a second after this line

https://github.com/mozilla/browsertime/blob/e37e3b0bfe2daa4dc0a099c640e557847c949abd/lib/firefox/webdriver/firefoxDelegate.js#L73

Is there some event that tells us the profiler is ready? 1s seems arbitrary.