Skip to content
59 changes: 42 additions & 17 deletions sql/2025/webassembly/counts.sql
Original file line number Diff line number Diff line change
@@ -1,35 +1,60 @@
# Query for wasm requests' count with distinct wasm origin name
# Query for wasm requests and sites counts

WITH wasmRequests AS (
SELECT
date,
client,
page,
CASE
WHEN REGEXP_CONTAINS(url, r'/(hyphenopoly|patterns).*/[a-z-]{2,5}\.wasm')
THEN '(hyphenopoly dictionary)'
WHEN ENDS_WITH(url, '.unityweb')
THEN '(unityweb app)'
ELSE
REGEXP_REPLACE(
REGEXP_EXTRACT(LOWER(url), r'./([^./?])'), -- lowercase & extract filename between last `/` and `.` or `?`
r'-[0-9a-f]{20,32}$', -- trim trailing hashes to transform `name-0abc43234[...]` to `name`
''
)
END AS name
root_page,
url,
REGEXP_EXTRACT(url, r'([^/]+)$') AS filename -- lowercase & extract filename between last `/` and `.` or `?`
FROM
`httparchive.crawl.requests`
WHERE
date = '2025-07-01' AND
type = 'wasm'
date IN ('2021-07-01', '2022-06-01', '2024-06-01', '2025-07-01') AND
(
(date IN ('2024-06-01', '2025-07-01') AND type = 'wasm') -- wasm type was added in Jan 2024
OR
(date IN ('2021-07-01', '2022-06-01') AND (JSON_VALUE(summary.mimeType) = 'application/wasm' OR JSON_VALUE(summary.ext) = 'wasm'))
)
),

totals AS (
SELECT
date,
client,
COUNT(DISTINCT root_page) AS total_sites,
COUNT(DISTINCT NET.REG_DOMAIN(page)) AS total_reg_domains
FROM
`httparchive.crawl.requests`
WHERE
date IN ('2021-07-01', '2022-06-01', '2024-06-01', '2025-07-01')
GROUP BY
date,
client
)

SELECT
date,
client,
COUNT(0) AS total_wasm,
COUNT(DISTINCT NET.REG_DOMAIN(page)) AS distinct_origin
COUNT(DISTINCT filename) AS unique_wasm,
COUNT(DISTINCT root_page) AS sites,
total_sites,
COUNT(DISTINCT root_page) / total_sites AS pct_sites,
COUNT(DISTINCT NET.REG_DOMAIN(page)) AS reg_domains,
total_reg_domains,
COUNT(DISTINCT NET.REG_DOMAIN(page)) / total_reg_domains AS pct_reg_domains
FROM
wasmRequests
INNER JOIN
totals
USING (date, client)
GROUP BY
client
date,
client,
total_sites,
total_reg_domains
ORDER BY
date DESC,
client
21 changes: 0 additions & 21 deletions sql/2025/webassembly/page_rankings.sql

This file was deleted.

48 changes: 48 additions & 0 deletions sql/2025/webassembly/ranking.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# WASM usage by page ranking

WITH totals AS (
SELECT
client,
rank_grouping,
COUNT(DISTINCT root_page) AS total_sites
FROM
`httparchive.crawl.requests`,
UNNEST([1000, 10000, 100000, 1000000, 10000000, 100000000]) AS rank_grouping
WHERE
date = '2025-07-01' AND
rank <= rank_grouping
GROUP BY
client,
rank_grouping
ORDER BY
client,
rank_grouping
)

SELECT
client,
rank_grouping,
CASE
WHEN rank_grouping = 100000000 THEN 'all'
ELSE FORMAT("%'d", rank_grouping)
END AS ranking,
COUNT(DISTINCT root_page) AS sites,
total_sites,
COUNT(DISTINCT root_page) / total_sites AS pct_sites
FROM
`httparchive.crawl.requests`,
UNNEST([1000, 10000, 100000, 1000000, 10000000, 100000000]) AS rank_grouping
INNER JOIN
totals
USING (client, rank_grouping)
WHERE
date = '2025-07-01' AND
type = 'wasm' AND
rank <= rank_grouping
GROUP BY
client,
rank_grouping,
total_sites
ORDER BY
client,
rank_grouping
3 changes: 1 addition & 2 deletions src/config/2025.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"chapter_number": "2",
"title": "WebAssembly",
"slug": "webassembly",
"hero_dir": "2021",
"todo": true
"hero_dir": "2021"
},
{
"part": "I",
Expand Down
16 changes: 15 additions & 1 deletion src/config/contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -3655,6 +3655,19 @@
]
}
},
"nimeshgit": {
"avatar_url": "38841604",
"github": "nimeshgit",
"linkedin": "ops-ml-architect",
"name": "Nimesh Vadgama - VN",
"teams": {
"2025": [
"analysts",
"authors"
]
},
"website": "https://ops-ml-architect.blogspot.com/"
},
"NishuGoel": {
"avatar_url": "26349046",
"github": "NishuGoel",
Expand Down Expand Up @@ -3744,8 +3757,9 @@
"reviewers"
],
"2025": [
"committee",
"leads",
"committee"
"reviewers"
]
},
"twitter": "nrllah",
Expand Down
Loading
Loading