nav-bench visual metrics include browsertime's FOG reset before each navigation
Categories
(Testing :: Raptor, defect, P1)
Tracking
(Not tracked)
People
(Reporter: acreskey, Assigned: acreskey)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [fxp][operational][todo])
nav-bench starts each measurement with measure.start(alias) and no URL, then navigates in a separate command. In that path browsertime starts the video recording first and then calls the Firefox delegate's beforeEachURL, which runs Services.fog.testFlushAllChildren() and Services.fog.testResetFOG() (browsertime/lib/firefox/webdriver/firefox.js).
The reset runs inside the recorded window, so its cost is added to FirstVisualChange and SpeedIndex for every page.
The reset only exists so that browsertime can read a per-page Glean.power.totalCpuTimeMs afterwards. nav-bench does not use that value.
This became visible with a Glean change that moves storage to SQLite: testResetFOG now closes the database (WAL checkpoint plus fsync) and blocks the parent main thread in glean_core::join_init while Glean reinitializes. On Linux, nav-bench SpeedIndex regressed 3-23% on every site:
https://perf.compare/compare-lando-results?landoInstance=lando-prod-2025&baseLando=114439&newLando=114440&baseRepo=try&newRepo=try&framework=13&sort=median-diff%7Cdesc&initialized=1&search=nav-bench+-profile
The browser was not slower in that comparison: median TTFB, FCP and loadEventEnd are unchanged or slightly better on every site, while FirstVisualChange is 40 ms later on every site (one frame at 25 fps).
Profile (google-nav-load, parent process main thread): the 68.7 ms Perform microtasks block starting with the fog.testResetFOG marker, right before WebDriver:Navigate:
https://share.firefox.dev/4ePHcQc
Options:
- Stop resetting FOG inside the measured window for nav-bench, for example by patching browsertime to call
beforeEachURLbefore_startVideo, or to skip the reset when the CPU metric is not needed. - Upstream, read
totalCpuTimeMsbefore and after each page and subtract, instead of resetting FOG.
| Assignee | ||
Comment 1•9 days ago
|
||
We might want to remove this from upstream Browsertime in the general case.
Updated•6 days ago
|
Updated•6 days ago
|
Comment 2•6 days ago
|
||
@acreskey assigning to you and setting priority/severity during grooming. Please correct if you feel these are wrong.
Comment 3•6 days ago
|
||
I'll wait until this is in upstream, then we can update browsertime (bug 2083786)
(since a btime upgrade can sometimes be quite disruptive, id prefer to not do it back to back)
| Assignee | ||
Comment 4•5 days ago
|
||
Upstream browsertime bug: https://github.com/sitespeedio/browsertime/issues/2654
Description
•