Closed Bug 1890559 Opened 25 days ago Closed 4 days ago

Remove Predictor code

Categories

(Core :: Networking, task, P2)

task

Tracking

()

RESOLVED WONTFIX

People

(Reporter: valentin, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [necko-triaged][necko-priority-queue])

We had a conversation about the Predictor and our current recommendation is that we remove the implementation:

  • It uses the cache to save metadata causing extra cache work and contention.
  • It does extra parsing work on the main thread.
  • It's functionality is similar to rel=prefetch and rel=dns-prefetch
  • Additional complexity and runtime cost are not balanced by noticeable perf improvements.

We did a few try runs, and it seems the predictor still seems to improve performance somewhat.
We'll do a proper experiment, and keep only the parts of the predictor that still make sense instead.

Status: NEW → RESOLVED
Closed: 4 days ago
Resolution: --- → WONTFIX

Valentin, can you share the try runs? I'm curious.

One thing I noticed is that network.predictor.enable-prefetch is enabled for IS_EARLY_BETA_OR_EARLIER. So this is enabled in our ci performance tests and local tests, but it's not what we are shipping.
Ideally, for performance evaluation and tests, the configurations would be identical unless we had a reason to hold a feature back.

https://searchfox.org/mozilla-central/rev/634e3a3b7408bc834445f89bc15a5d0995322b88/modules/libpref/init/StaticPrefList.yaml#11978-11981,11983-11986

network.predictor.enable-hover-on-ssl is currently disabled, which I think is correct given that this could be a potential privacy leak.

So I'm wondering what the Predictor actually does in a release build?

Startup prediction and redirection prediction? Not actually clear to me!

Flags: needinfo?(valentin.gosu)

I have a try run here

(In reply to Andrew Creskey [:acreskey] from comment #2)

Valentin, can you share the try runs? I'm curious.

One thing I noticed is that network.predictor.enable-prefetch is enabled for IS_EARLY_BETA_OR_EARLIER. So this is enabled in our ci performance tests and local tests, but it's not what we are shipping.
Ideally, for performance evaluation and tests, the configurations would be identical unless we had a reason to hold a feature back.

I agree. The prefetch bit only covers what the predictor does - see here
If prefetching is disabled, the predictor will either preconnect or preresolve the URI.

https://searchfox.org/mozilla-central/rev/634e3a3b7408bc834445f89bc15a5d0995322b88/modules/libpref/init/StaticPrefList.yaml#11978-11981,11983-11986

network.predictor.enable-hover-on-ssl is currently disabled, which I think is correct given that this could be a potential privacy leak.

So I'm wondering what the Predictor actually does in a release build?

Startup prediction and redirection prediction? Not actually clear to me!

PREDICT_STARTUP or LEARN_STARTUP don't appear to be used outside a small unit test.

Unfortunately, redirect prediction also seems to be unimplemented

As far as I can tell, the major benefit of the predictor comes from doing the preconnect and preresolve earlier than normal - but that's just a guess. I'll have to actually dig into the code some more to figure out why this is working at all. 🙂

Flags: needinfo?(valentin.gosu)
You need to log in before you can comment on or make changes to this bug.