From 122ec52368d8b8a1bafbe5bea31a85901c88df64 Mon Sep 17 00:00:00 2001 From: Tanner Hodges Date: Tue, 16 Dec 2025 20:12:24 -0500 Subject: [PATCH 1/4] speculation_rules_rank.sql --- .../performance/speculation_rules_rank.sql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sql/2025/performance/speculation_rules_rank.sql diff --git a/sql/2025/performance/speculation_rules_rank.sql b/sql/2025/performance/speculation_rules_rank.sql new file mode 100644 index 00000000000..1e5cb63d373 --- /dev/null +++ b/sql/2025/performance/speculation_rules_rank.sql @@ -0,0 +1,22 @@ +SELECT + IF(ranking < 100000000, CAST(ranking AS STRING), 'all') AS ranking, + client, + COUNTIF( + custom_metrics.performance.speculation_rules IS NOT NULL AND ( + ARRAY_LENGTH(JSON_QUERY_ARRAY(custom_metrics.performance.speculation_rules.htmlRules)) > 0 OR + ARRAY_LENGTH(JSON_QUERY_ARRAY(custom_metrics.performance.speculation_rules.httpHeaderRules)) > 0 + ) + ) / COUNT(0) AS has_speculation_rules +FROM + `httparchive.crawl.pages`, + UNNEST([1000, 10000, 100000, 1000000, 10000000, 100000000]) AS ranking +WHERE + date = '2025-07-01' AND + is_root_page AND + rank <= ranking +GROUP BY + ranking, + client +ORDER BY + ranking, + client From b75d9564b55ccd7c89f8053cc060e008a54805c3 Mon Sep 17 00:00:00 2001 From: Tanner Hodges Date: Wed, 17 Dec 2025 20:57:33 -0500 Subject: [PATCH 2/4] early_hints_usage_rank.sql --- .../performance/early_hints_usage_rank.sql | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 sql/2025/performance/early_hints_usage_rank.sql diff --git a/sql/2025/performance/early_hints_usage_rank.sql b/sql/2025/performance/early_hints_usage_rank.sql new file mode 100644 index 00000000000..294746758eb --- /dev/null +++ b/sql/2025/performance/early_hints_usage_rank.sql @@ -0,0 +1,31 @@ +#standardSQL +# Early Hints (HTTP 103) usage by site rank +# Measures the percentage of sites using early hints at different popularity ranks + +SELECT + IF(ranking < 100000000, CAST(ranking AS STRING), 'all') AS ranking, + r.client, + COUNT(DISTINCT r.page) AS total_sites, + COUNTIF(JSON_QUERY_ARRAY(r.payload._early_hint_headers) IS NOT NULL) AS sites_with_early_hints, + COUNTIF(JSON_QUERY_ARRAY(r.payload._early_hint_headers) IS NOT NULL) / COUNT(DISTINCT r.page) AS pct_early_hints +FROM + `httparchive.crawl.requests` r +JOIN + `httparchive.crawl.pages` p +ON + r.page = p.page AND + r.client = p.client AND + r.date = p.date, + UNNEST([1000, 10000, 100000, 1000000, 10000000, 100000000]) AS ranking +WHERE + r.date = '2025-07-01' AND + r.is_main_document AND + r.is_root_page AND + p.is_root_page AND + p.rank <= ranking +GROUP BY + ranking, + r.client +ORDER BY + ranking, + r.client From 8247abc9c0d061fed0ff784824a363bc8ceeafbf Mon Sep 17 00:00:00 2001 From: Tanner Hodges Date: Wed, 17 Dec 2025 21:36:19 -0500 Subject: [PATCH 3/4] early_hints_usage_trends.sql --- .../performance/early_hints_usage_trends.sql | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sql/2025/performance/early_hints_usage_trends.sql diff --git a/sql/2025/performance/early_hints_usage_trends.sql b/sql/2025/performance/early_hints_usage_trends.sql new file mode 100644 index 00000000000..b9f1cf7821c --- /dev/null +++ b/sql/2025/performance/early_hints_usage_trends.sql @@ -0,0 +1,35 @@ +#standardSQL +# Early Hints (HTTP 103) adoption trend over time +# Shows usage by client (mobile, desktop) across years + +SELECT + r.client AS client, + r.date AS date, + COUNTIF( + JSON_QUERY_ARRAY(r.payload._early_hint_headers) IS NOT NULL AND + ARRAY_LENGTH(JSON_QUERY_ARRAY(r.payload._early_hint_headers)) > 0 + ) AS sites, + COUNT(0) AS total, + COUNTIF( + JSON_QUERY_ARRAY(r.payload._early_hint_headers) IS NOT NULL AND + ARRAY_LENGTH(JSON_QUERY_ARRAY(r.payload._early_hint_headers)) > 0 + ) / COUNT(0) AS pct +FROM + `httparchive.crawl.requests` r +JOIN + `httparchive.crawl.pages` p +ON + r.page = p.page AND + r.client = p.client AND + r.date = p.date +WHERE + r.date IN ('2023-07-01', '2024-07-01', '2025-07-01') AND + r.is_main_document AND + r.is_root_page AND + p.is_root_page +GROUP BY + r.client, + r.date +ORDER BY + r.client, + r.date From 0f99c99b18e47ee0a135f9a7cce3df2e8330f075 Mon Sep 17 00:00:00 2001 From: Tanner Hodges Date: Wed, 17 Dec 2025 21:36:42 -0500 Subject: [PATCH 4/4] Add total columns to speculation_rules_rank.sql --- sql/2025/performance/speculation_rules_rank.sql | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/2025/performance/speculation_rules_rank.sql b/sql/2025/performance/speculation_rules_rank.sql index 1e5cb63d373..fb30342978d 100644 --- a/sql/2025/performance/speculation_rules_rank.sql +++ b/sql/2025/performance/speculation_rules_rank.sql @@ -1,12 +1,19 @@ SELECT IF(ranking < 100000000, CAST(ranking AS STRING), 'all') AS ranking, client, + COUNT(DISTINCT page) AS total_sites, COUNTIF( custom_metrics.performance.speculation_rules IS NOT NULL AND ( ARRAY_LENGTH(JSON_QUERY_ARRAY(custom_metrics.performance.speculation_rules.htmlRules)) > 0 OR ARRAY_LENGTH(JSON_QUERY_ARRAY(custom_metrics.performance.speculation_rules.httpHeaderRules)) > 0 ) - ) / COUNT(0) AS has_speculation_rules + ) AS sites_with_speculation_rules, + COUNTIF( + custom_metrics.performance.speculation_rules IS NOT NULL AND ( + ARRAY_LENGTH(JSON_QUERY_ARRAY(custom_metrics.performance.speculation_rules.htmlRules)) > 0 OR + ARRAY_LENGTH(JSON_QUERY_ARRAY(custom_metrics.performance.speculation_rules.httpHeaderRules)) > 0 + ) + ) / COUNT(DISTINCT page) AS pct_speculation_rules FROM `httparchive.crawl.pages`, UNNEST([1000, 10000, 100000, 1000000, 10000000, 100000000]) AS ranking