Open Bug 2081350 Opened 1 month ago Updated 18 days ago

Consider running multiple iterations of nav-bench navigations per browser launch

Categories

(Testing :: Performance, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: acreskey, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxp][operational][vision][todo])

Currently nav-bench does the following:

  • launches,
  • idles a bit,
  • run the ~11 navigation tests
  • shut down.

It would be more efficient (and also more amenable to AI driven performance optimization) if we could get more signal from a single run.

So consider running multiple iterations per launch.
e.g.

  • launch
  • idle a bit (minimal amount)
  • for i=1 to n
    • run the ~11 navigation tests
    • clear network cache, active connections, etc
  • shut down
Blocks: 2057233
Severity: N/A → S3
Whiteboard: [fxp][operational][vision][todo]

i have been thinking about this. I don't see why not to do it (i guess data would tell us otherwise)
the multiple browser cycles thing was a legacy picked up from tp6 while prototyping this.

i would suspect and hope that forcing a GC/clear network cache/active connections as mentioned would be a good stand in for a new browser cycle

It's easy to try ;)

prelim results...

perfcompare: https://perf.compare/compare-results?baseRev=3c1da72d310612b586084b0d294cc5677c8abab8&baseRepo=try&newRev=2d54d49f50890422a826a9109062d26f6045b66a&newRepo=try&framework=13

overall

platform score base → new cov across jobs base → new median task time
linux 78.7 → 85.0 (+8%) 1.2% → 1.3% 24 → 22 min
macos 154.8 → 167.9 (+8.5%) 1.7% → 1.2% 22 → 19 min
windows 92.4 → 106.4 (+15%) 0.6% → 0.9% 27 → 24 min

overall cov holds up but a few subtests get a lot noisier within a job:

subtest linux macos windows pattern across iterations
google-nav-load 4% → 12% 9% → 14% 8% → 30% iter 1 matches base, iters 2 to 5 are 25 to 100% faster
wikipedia-nav-load 6% → 14% 4% → 16% 8% → 18% flat for iters 1 to 3, jumps ~30% at iters 4 and 5
duckduckgo-nav-load 4% → 6% 2% → 8% 4% → 12% flips high/low every iteration
facebook-nav-load 7% → 11% windows only, iters 2+ faster

(within job cov of each subtest's 5 samples, averaged over ~10 jobs per side)

everything else (amazon, bbc, reddit, yahoo, google docs, subnavs) stays about as noisy as base, some a bit better

so the score bump is mostly from those pages getting faster after iteration 1. cache + connections + gc doesn't fully stand in for a new browser cycle yet, something carries over between iterations for those sites.

will have to investigate further. gecko profile runs might have a clue

using profiler-cli:

looked through the gecko profiles from the multi iteration try run (9 nav-bench-p jobs, 3 per platform). two things show up in every job

google: iteration 1 is slow because the first tls handshake after startup seems to wait on the pkcs#11 utility process starting up. that process is on by default in nightly since bug 2079970. in the parent there's a UtilityProcessManager::StartUtility marker for PKCS11_MODULE that lines up with the first google doc request, and it's not there in iteration 2+

platform google doc request, iter 1 pkcs#11 process start google doc request, iter 2+
linux ~400 ms ~390 ms ~20 to 50 ms
macos ~72 ms ~27 ms ~24 ms
windows ~44 ms ~29 ms ~30 ms

so in base, every google sample includes this since each one is a fresh launch. on linux it's almost all of the tls time. i think that explains a lot of why google looks faster (and noisier) with multi iteration. this is just from the timings lining up though, i don't have a stack showing the handshake actually blocked on it

wikipedia: fcp and the doc request don't change, but lcp drops ~55% starting at iteration 4 (linux ~1250 → ~510 ms, mac ~305 → ~135, win ~720 → ~295). probably site state carrying over between iterations since we clear caches but not cookies/localstorage... not sure yet what exactly changes on the page

duckduckgo and yahoo don't show any trend in fcp/lcp/doc timings

(In reply to Kash Shampur [:kshampur] ⌚EST from comment #4)

using profiler-cli:
...
google: iteration 1 is slow because the first tls handshake after startup seems to wait on the pkcs#11 utility process starting up. that process is on by default in nightly since bug 2079970. in the parent there's a UtilityProcessManager::StartUtility marker for PKCS11_MODULE that lines up with the first google doc request, and it's not there in iteration 2+

Ah, good find.
Since most users don't have third party modules installed, waiting for that process doesn't seem ideal. But we will have to ask the security folks, I don't have a good understanding of this.

You need to log in before you can comment on or make changes to this bug.