tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 7414afd9dba78738111fda0ddf1a6fe5823053c7
parent da7ceec18dd01ef733647e5a22fed2eb8e60fb1c
Author: acreskeyMoz <acreskey@mozilla.com>
Date:   Wed, 12 Nov 2025 18:32:46 +0000

Bug 1997949 - Add a test for Fenix DoH performance during concurrent DNS resolutions and HTTP requests r=sparky,necko-reviewers,perftest-reviewers,valentin

This will be helpful in maintaining and improving DoH performance.

Differential Revision: https://phabricator.services.mozilla.com/D271488

Diffstat:
Mtaskcluster/kinds/browsertime/desktop.yml | 1+
Mtaskcluster/kinds/browsertime/mobile.yml | 1+
Mtesting/perfdocs/generated/raptor.rst | 252+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atesting/raptor/browsertime/trr_multi_domain_performance.js | 112+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/raptor/raptor/perfdocs/config.yml | 2++
Mtesting/raptor/raptor/tests/custom/browsertime-trr-performance.toml | 14++++++++++++++
6 files changed, 382 insertions(+), 0 deletions(-)

diff --git a/taskcluster/kinds/browsertime/desktop.yml b/taskcluster/kinds/browsertime/desktop.yml @@ -1264,6 +1264,7 @@ browsertime-trr-performance: - trr-comcas - trr-next - trr-native + - trr-multi - trr-w-clou - trr-w-cira - trr-w-comc diff --git a/taskcluster/kinds/browsertime/mobile.yml b/taskcluster/kinds/browsertime/mobile.yml @@ -570,6 +570,7 @@ browsertime-trr-performance-m: - trr-clou-m - trr-next-m - trr-natv-m + - trr-multm - trr-w-cl-m - trr-w-ne-m diff --git a/testing/perfdocs/generated/raptor.rst b/testing/perfdocs/generated/raptor.rst @@ -17821,6 +17821,258 @@ Browsertime tests that use a custom pageload test script. These use the pageload +.. dropdown:: trr-multi + :class-container: anchor-id-trr-multi-c + + * Command to Run Locally + + .. code-block:: + + ./mach raptor -t trr-multi + + **Owner**: Network Team + + **Description**: Tests multi-domain DNS lookup and pageload performance on a Cloudflare TRR server. + + * **alert threshold**: 2.0 + * **apps**: firefox,fenix + * **browser cycles**: 3 + * **browsertime args**: --browsertime.test_type=browser_idle --firefox.preference network.trr.mode:3 --firefox.preference network.trr.uri:https://mozilla.cloudflare-dns.com/dns-query + * **cold**: true + * **custom data**: true + * **expected**: pass + * **gecko profile interval**: 1 + * **link searchfox**: `<https://searchfox.org/mozilla-central/source/testing/raptor/raptor/tests/custom/browsertime-trr-performance.toml#114>`__ + * **lower is better**: true + * **page cycles**: 1 + * **page timeout**: 60000 + * **test script**: trr_multi_domain_performance.js + * **test url**: `<None>`__ + * **type**: pageload + * **unit**: ms + * **use live sites**: true + * **Test Task**: + + .. list-table:: **test-linux1804-64-nightlyasrelease-qr/opt** + :widths: 30 15 15 15 15 + :header-rows: 1 + + * - **Test Name** + - mozilla-central + - autoland + - mozilla-release + - mozilla-beta + * - **browsertime-trr-performance-firefox-trr-multi** + - ❌ + - ❌ + - ❌ + - ❌ + + + .. list-table:: **test-linux1804-64-qr/opt** + :widths: 30 15 15 15 15 + :header-rows: 1 + + * - **Test Name** + - mozilla-central + - autoland + - mozilla-release + - mozilla-beta + * - **browsertime-trr-performance-firefox-trr-multi** + - ❌ + - ❌ + - ❌ + - ❌ + + + .. list-table:: **test-linux1804-64-shippable-qr/opt** + :widths: 30 15 15 15 15 + :header-rows: 1 + + * - **Test Name** + - mozilla-central + - autoland + - mozilla-release + - mozilla-beta + * - **browsertime-trr-performance-firefox-trr-multi** + - ❌ + - ❌ + - ❌ + - ❌ + + + .. list-table:: **test-macosx1470-64-nightlyasrelease/opt** + :widths: 30 15 15 15 15 + :header-rows: 1 + + * - **Test Name** + - mozilla-central + - autoland + - mozilla-release + - mozilla-beta + * - **browsertime-trr-performance-firefox-trr-multi** + - ❌ + - ❌ + - ❌ + - ❌ + + + .. list-table:: **test-macosx1470-64-shippable/opt** + :widths: 30 15 15 15 15 + :header-rows: 1 + + * - **Test Name** + - mozilla-central + - autoland + - mozilla-release + - mozilla-beta + * - **browsertime-trr-performance-firefox-trr-multi** + - ❌ + - ❌ + - ❌ + - ❌ + + + .. list-table:: **test-macosx1470-64/opt** + :widths: 30 15 15 15 15 + :header-rows: 1 + + * - **Test Name** + - mozilla-central + - autoland + - mozilla-release + - mozilla-beta + * - **browsertime-trr-performance-firefox-trr-multi** + - ❌ + - ❌ + - ❌ + - ❌ + + + .. list-table:: **test-windows11-64-24h2-nightlyasrelease/opt** + :widths: 30 15 15 15 15 + :header-rows: 1 + + * - **Test Name** + - mozilla-central + - autoland + - mozilla-release + - mozilla-beta + * - **browsertime-trr-performance-firefox-trr-multi** + - ❌ + - ❌ + - ❌ + - ❌ + + + .. list-table:: **test-windows11-64-24h2-shippable/opt** + :widths: 30 15 15 15 15 + :header-rows: 1 + + * - **Test Name** + - mozilla-central + - autoland + - mozilla-release + - mozilla-beta + * - **browsertime-trr-performance-firefox-trr-multi** + - ✅ + - ❌ + - ❌ + - ❌ + + + .. list-table:: **test-windows11-64-24h2/opt** + :widths: 30 15 15 15 15 + :header-rows: 1 + + * - **Test Name** + - mozilla-central + - autoland + - mozilla-release + - mozilla-beta + * - **browsertime-trr-performance-firefox-trr-multi** + - ❌ + - ❌ + - ❌ + - ❌ + + + +.. dropdown:: trr-multm + :class-container: anchor-id-trr-multm-c + + * Command to Run Locally + + .. code-block:: + + ./mach raptor -t trr-multm + + **Owner**: Network Team + + **Description**: Tests multi-domain DNS lookup and pageload performance on a Cloudflare TRR server, mobile. + + * **alert threshold**: 2.0 + * **apps**: firefox,fenix + * **browser cycles**: 3 + * **browsertime args**: --browsertime.test_type=browser_idle --firefox.preference network.trr.mode:3 --firefox.preference network.trr.uri:https://mozilla.cloudflare-dns.com/dns-query + * **cold**: true + * **custom data**: true + * **expected**: pass + * **gecko profile interval**: 1 + * **link searchfox**: `<https://searchfox.org/mozilla-central/source/testing/raptor/raptor/tests/custom/browsertime-trr-performance.toml#121>`__ + * **lower is better**: true + * **page cycles**: 1 + * **page timeout**: 60000 + * **test script**: trr_multi_domain_performance.js + * **test url**: `<None>`__ + * **type**: pageload + * **unit**: ms + * **use live sites**: true + * **Test Task**: + + .. list-table:: **test-android-hw-a55-14-0-aarch64-shippable/opt** + :widths: 30 15 15 15 15 + :header-rows: 1 + + * - **Test Name** + - mozilla-central + - autoland + - mozilla-release + - mozilla-beta + * - **browsertime-trr-performance-m-fenix-trr-multm** + - ✅ + - ❌ + - ❌ + - ❌ + * - **browsertime-trr-performance-m-fenix-trr-multm-nofis** + - ✅ + - ❌ + - ❌ + - ❌ + + + .. list-table:: **test-android-hw-a55-14-0-aarch64/opt** + :widths: 30 15 15 15 15 + :header-rows: 1 + + * - **Test Name** + - mozilla-central + - autoland + - mozilla-release + - mozilla-beta + * - **browsertime-trr-performance-m-fenix-trr-multm** + - ❌ + - ❌ + - ❌ + - ❌ + * - **browsertime-trr-performance-m-fenix-trr-multm-nofis** + - ❌ + - ❌ + - ❌ + - ❌ + + + .. dropdown:: trr-native :class-container: anchor-id-trr-native-c diff --git a/testing/raptor/browsertime/trr_multi_domain_performance.js b/testing/raptor/browsertime/trr_multi_domain_performance.js @@ -0,0 +1,112 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* eslint-env node */ +/* global require, module */ + +const { logTest } = require("./utils/profiling"); + +module.exports = logTest( + "multi-domain dns lookup pageload", + async function (context, commands) { + context.log.info( + "Starting multi-domain pageload to measure DNS lookup time" + ); + + const testType = `${context.options.browsertime.test_type}`; + context.log.info("testType: " + testType); + + const url = + "https://mozilla-necko.github.io/tests/dns/trr_multi_domain.html"; + + await commands.navigate("about:blank"); + + // Idle to allow for confirmation + await commands.wait.byTime(5000); + + if (testType === "trr_warm") { + // Ensure the trr connection has been warmed up by making an arbitrary request + await commands.navigate("https://www.w3.org"); + await commands.wait.byTime(2000); + } + + // Start measuring + await commands.measure.start(); + await commands.navigate(url); + + // Wait for all domains to load (or fail) + await commands.wait.byTime(10000); + + await commands.measure.stop(); + + // Get pageload time + let pageload_time = await commands.js.run(` + return (window.performance.timing.loadEventEnd - window.performance.timing.navigationStart); + `); + + // Extract DNS timing data from the page + let dns_data = await commands.js.run(` + const entries = window.performance.getEntriesByType('resource'); + + let totalDNS = 0; + let maxDNS = 0; + let minDNS = Infinity; + let dnsCount = 0; + + const dnsTimings = []; + + entries.forEach(entry => { + const dnsTime = entry.domainLookupEnd - entry.domainLookupStart; + if (dnsTime > 0) { + totalDNS += dnsTime; + maxDNS = Math.max(maxDNS, dnsTime); + minDNS = Math.min(minDNS, dnsTime); + dnsCount++; + dnsTimings.push({ + url: entry.name, + dns_time: dnsTime + }); + } + }); + + return { + avg_dns_lookup_time: dnsCount > 0 ? totalDNS / dnsCount : 0, + total_dns_lookup_time: totalDNS, + total_resource_entries: entries.length, + dns_entries_count: dnsCount, + max_dns_lookup_time: maxDNS === 0 ? 0 : maxDNS, + min_dns_lookup_time: minDNS === Infinity ? 0 : minDNS, + dns_timings: dnsTimings + }; + `); + + context.log.info("pageload_time: " + pageload_time); + context.log.info( + "total_resource_entries: " + dns_data.total_resource_entries + ); + context.log.info("dns_entries_count: " + dns_data.dns_entries_count); + context.log.info("avg_dns_lookup_time: " + dns_data.avg_dns_lookup_time); + context.log.info( + "total_dns_lookup_time: " + dns_data.total_dns_lookup_time + ); + context.log.info("max_dns_lookup_time: " + dns_data.max_dns_lookup_time); + context.log.info("min_dns_lookup_time: " + dns_data.min_dns_lookup_time); + + await commands.measure.addObject({ + custom_data: { + pageload_time, + total_resource_entries: dns_data.total_resource_entries, + dns_entries_count: dns_data.dns_entries_count, + avg_dns_lookup_time: dns_data.avg_dns_lookup_time, + total_dns_lookup_time: dns_data.total_dns_lookup_time, + max_dns_lookup_time: dns_data.max_dns_lookup_time, + min_dns_lookup_time: dns_data.min_dns_lookup_time, + dns_timings: dns_data.dns_timings, + }, + }); + + context.log.info("Multi-domain DNS lookup test finished."); + return true; + } +); diff --git a/testing/raptor/raptor/perfdocs/config.yml b/testing/raptor/raptor/perfdocs/config.yml @@ -248,6 +248,7 @@ suites: trr-comcas: "Tests DNS lookup time on a Comcast TRR server." trr-next: "Tests DNS lookup time on a NextDNS TRR server." trr-native: "Tests DNS lookup time via native DNS." + trr-multi: "Tests multi-domain DNS lookup and pageload performance on a Cloudflare TRR server." trr-w-clou: "Tests DNS lookup time on a Cloudflare TRR server, with the TRR connection warmed up." trr-w-cira: "Tests DNS lookup time on a CIRA TRR server, with the TRR connection warmed up." trr-w-comc: "Tests DNS lookup time on a Comcast TRR server, with the TRR connection warmed up." @@ -255,6 +256,7 @@ suites: trr-clou-m: "Tests DNS lookup time on a Cloudflare TRR server, mobile." trr-next-m: "Tests DNS lookup time on a NextDNS TRR server, mobile." trr-natv-m: "Tests DNS lookup time via native DNS, mobile." + trr-multm: "Tests multi-domain DNS lookup and pageload performance on a Cloudflare TRR server, mobile." trr-w-cl-m: "Tests DNS lookup time on a Cloudflare TRR server, with the TRR connection warmed up, mobile." trr-w-ne-m: "Tests DNS lookup time on a NextDNS TRR server, with the TRR connection warmed up, mobile." upload: "Measures HTTP/2 file upload throughput with a remote server" diff --git a/testing/raptor/raptor/tests/custom/browsertime-trr-performance.toml b/testing/raptor/raptor/tests/custom/browsertime-trr-performance.toml @@ -110,3 +110,17 @@ browser_cycles = 3 test_script = "trr_performance.js" test_url = "None" custom_data = true + +["trr-multi"] +browsertime_args = "--browsertime.test_type=browser_idle --firefox.preference network.trr.mode:3 --firefox.preference network.trr.uri:https://mozilla.cloudflare-dns.com/dns-query" +browser_cycles = 3 +test_script = "trr_multi_domain_performance.js" +test_url = "None" +custom_data = true + +["trr-multm"] +browsertime_args = "--browsertime.test_type=browser_idle --firefox.preference network.trr.mode:3 --firefox.preference network.trr.uri:https://mozilla.cloudflare-dns.com/dns-query" +browser_cycles = 3 +test_script = "trr_multi_domain_performance.js" +test_url = "None" +custom_data = true