SELECT
year,
type,
CONCAT(STRING(INTEGER(100 * (COUNT - prev) / prev)),
'%') year_growth,
count,
prev prev_count from(
SELECT
COUNT,
LAG(COUNT) OVER(
PARTITION BY
type
ORDER BY
year ) prev,
type,
year
FROM (
SELECT
type,
COUNT,
year
FROM (
SELECT
REGEXP_EXTRACT(url,
r'(jquery|dojo|angular|prototype)') type,
COUNT(DISTINCT(pageid)) COUNT,
'2013' year
FROM
[httparchive:runs.2013_06_01_requests]
WHERE
REGEXP_MATCH(url,
r'jquery|dojo|angular|prototype')
GROUP BY
type),
(
SELECT
REGEXP_EXTRACT(url,
r'(jquery|dojo|angular|prototype)') type,
COUNT(DISTINCT(pageid)) COUNT,
'2012' year
FROM
[httparchive:runs.2012_06_01_requests]
WHERE
REGEXP_MATCH(url,
r'jquery|dojo|angular|prototype')
GROUP BY
type),
(
SELECT
REGEXP_EXTRACT(url,
r'(jquery|dojo|angular|prototype)') type,
COUNT(DISTINCT(pageid)) COUNT,
'2011' year
FROM
[httparchive:runs.2011_06_01_requests]
WHERE
REGEXP_MATCH(url,
r'jquery|dojo|angular|prototype')
GROUP BY
type),
))
WHERE prev IS NOT NULL
ORDER BY year, type
| year | type | year_growth | count | prev_count |
|-------|------------|--------------|---------|------------|
| 2012 | angular | 1183% | 77 | 6 |
| 2012 | dojo | 420% | 604 | 116 |
| 2012 | jquery | 1178% | 98789 | 7727 |
| 2012 | prototype | 765% | 7986 | 923 |
| 2013 | angular | 205% | 235 | 77 |
| 2013 | dojo | 60% | 970 | 604 |
| 2013 | jquery | 74% | 172438 | 98789 |
| 2013 | prototype | 16% | 9295 | 7986 |
|-------|------------|--------------|---------|------------|
Turns out on 2013 prototype only grew 16%! Other frameworks also had a slow down in growth but not as marked. I wonder why 2012 growth was so big for all of them:
Hmm. I’m guessing, it’s due to the change in number of sites tracked: http://httparchive.org/about.php#testchanges
Perhaps we should be tracking the relative %, instead of absolute counts?
Mmmh… looking at the same data in a relative way:
In 2012 Angular and jQuery grew at the same rate. Prototype grew at a slightly higher rate than Dojo, but both at around half the rate than Angular and jQuery.
In 2013 Angular grew 3 times faster than jQuery. Dojo grew almost as fast as jQuery. Prototype was left behind, with a growth roughly a 1/4 of Dojo.
Interesting. Come to think of it, here’s another interesting dimension: if you join against the pages table, the site also has a “rank”, which is the Alexa rank… We can partition the data and look at adoption and growth in Top 1K, 10K, etc!