Closed Bug 1883496 Opened 8 months ago Closed 5 months ago

Move search header interception into Necko

Categories

(Core :: Networking: HTTP, enhancement, P2)

All
Android
enhancement

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: royang, Assigned: smayya)

References

(Blocks 1 open bug)

Details

(Keywords: perf-alert, Whiteboard: [necko-triaged][necko-priority-queue])

Attachments

(2 files)

Currently we use URL interceptor to decide if we should intercept and add additional headers depending on the URL. However, this resulted in some behaviours that we do not want in corner cases.

  1. Toolbar search term is cleared too early,
  2. Reload behaviour is modified.

To avoid these problems, move interception behaviour into GeckoEngineSession so we add the additional headers when calling loadUrl.

The idea here is when we create the GeckoEngineSession (or after we create it we call a new API), we give GeckoEngineSession a map(or a pair initially) of {}->Boolean and a Map<String, String>. If {}->Boolean return true, then we add the header specified in the map.

This way, we only apply the header when we call loadUrl. then we don't have to intercept anymore

Whiteboard: [fxdroid]

+Valentin for awareness. Another idea would be to bake the tier 1 header specifically directly into Necko (gated behind a pref, or something). But it sounds like this is highlighting an underlying issue in the existing interception which would affect other consumers of the API, so makes sense to fix this regardless.

It would be much better - both for performance and maintainability - to add these headers in Necko instead of relying on channel interception to do it.

Severity: -- → S3
Component: Search → Networking: HTTP
Priority: -- → P2
Product: Fenix → Core
Whiteboard: [fxdroid] → [necko-triaged][necko-priority-next]
Summary: Move search header interception into Gecko Engine Session → Move search header interception into Necko

To implement in this Necko, I think we need the following steps:

  • Implement IsDeviceRamAboveThreshold in Gecko AppShell
  • Implement a wrapper in nsAndroidNetworkLinkService that wraps IsDeviceRamAboveThreshold in Gecko AppShell
  • Implement a helper function IsGoogleDomain() to match google domain and path described here
  • Add the header X-Search-Subdivision in asyncOpen if IsDeviceRamAboveThreshold is true.
Assignee: nobody → smayya
Attachment #9398139 - Attachment description: WIP: Bug 1883496 - add X-Search-Subdivision assignment for android. r=#necko → Bug 1883496 - add X-Search-Subdivision assignment for android. r=#necko
Whiteboard: [necko-triaged][necko-priority-next] → [necko-triaged][necko-priority-queue]
See Also: → 1894642
Pushed by smayya@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2f6444926c9c add X-Search-Subdivision assignment for android. r=necko-reviewers,android-reviewers,geckoview-reviewers,valentin,gl,owlish,Roger https://hg.mozilla.org/integration/autoland/rev/01f2eb842653 Part 2: Remove UrlRequestInterceptor in Fenix r=android-reviewers,Roger
Regressions: 1897944
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
Blocks: 1898203

(In reply to Pulsebot from comment #7)

Pushed by smayya@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2f6444926c9c
add X-Search-Subdivision assignment for android.
r=necko-reviewers,android-reviewers,geckoview-reviewers,valentin,gl,owlish,
Roger
https://hg.mozilla.org/integration/autoland/rev/01f2eb842653
Part 2: Remove UrlRequestInterceptor in Fenix r=android-reviewers,Roger

Perfherder has detected a browsertime performance change from push 01f2eb8426531aba2c35399292dc11f539b3ccff.

Improvements:

Ratio Test Platform Options Absolute values (old vs new) Performance Profiles
24% google-search-restaurants FirstVisualChange android-hw-a51-11-0-aarch64-shippable-qr warm webrender 246.88 -> 186.88 Before/After
23% google-search-restaurants PerceptualSpeedIndex android-hw-a51-11-0-aarch64-shippable-qr warm webrender 249.62 -> 193.38 Before/After
18% google-search-restaurants SpeedIndex android-hw-a51-11-0-aarch64-shippable-qr warm webrender 266.14 -> 219.04 Before/After
17% google-search-restaurants SpeedIndex android-hw-a51-11-0-aarch64-shippable-qr warm webrender 265.54 -> 221.26 Before/After
13% google-search-restaurants ContentfulSpeedIndex android-hw-a51-11-0-aarch64-shippable-qr warm webrender 258.11 -> 224.61 Before/After

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.

You can run these tests on try with ./mach try perf --alert 467

For more information on performance sheriffing please see our FAQ.

Keywords: perf-alert

This looks like the reverse of bug 1876370, so it looks like this patch has indeed fixed the regression from bug 1866133. Thank you!

(Unfortunately I can't find a continuous graph that shows both the regression and the improvement, it looks like we lost the old graphs in the monorepo migration.)

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

Attachment

General

Creator:
Created:
Updated:
Size: