This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function () { | |
function reportWebVitals(metric, debugData) { | |
var name = metric.name, | |
delta = metric.delta, | |
id = metric.id, | |
navigationType = metric.navigationType, | |
value = metric.value, | |
entry = metric.entries[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste this into console to prerender all links on hover | |
function prerenderInAction() { | |
const script_ = document.createElement('script'); | |
script_.type = 'speculationrules'; | |
script_.textContent = ` | |
{ | |
"prerender": [ | |
{ | |
"where": { | |
"href_matches": "/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#standardSQL | |
# Core WebVitals by country | |
CREATE TEMP FUNCTION IS_GOOD (good FLOAT64, needs_improvement FLOAT64, poor FLOAT64) RETURNS BOOL AS ( | |
SAFE_DIVIDE(good, (good + needs_improvement + poor)) >= 0.75 | |
); | |
CREATE TEMP FUNCTION IS_POOR (good FLOAT64, needs_improvement FLOAT64, poor FLOAT64) RETURNS BOOL AS ( | |
SAFE_DIVIDE(poor, (good + needs_improvement + poor)) >= 0.25 | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#standardSQL | |
# Core WebVitals by origin | |
CREATE TEMP FUNCTION IS_GOOD (good FLOAT64, needs_improvement FLOAT64, poor FLOAT64) RETURNS BOOL AS ( | |
SAFE_DIVIDE(good, (good + needs_improvement + poor)) >= 0.75 | |
); | |
CREATE TEMP FUNCTION IS_POOR (good FLOAT64, needs_improvement FLOAT64, poor FLOAT64) RETURNS BOOL AS ( | |
SAFE_DIVIDE(poor, (good + needs_improvement + poor)) >= 0.25 | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credit to Michal Mocny (https://twitter.com/mmocny) | |
// | |
// Copy and paste this into the console and click around to see all interactions, whether they would pass INP, | |
// and if you expand the entry you'll see the debug breakdown information. | |
// | |
// This is basically the same as the Core Web Vitals extension does: https://web.dev/debug-cwvs-with-web-vitals-extension/ | |
const valueToRating = (score) => score <= 200 ? 'good' : score <= 500 ? 'needs-improvement' : 'poor'; | |
const COLOR_GOOD = '#0CCE6A'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ nghttp https://stuart-mcmillan.com/tests/earlyhints_use_css.html -anv -H'user-agent: Chrome' --no-push | |
[ 0.384] Connected | |
The negotiated protocol: h2 | |
[ 0.567] send SETTINGS frame <length=18, flags=0x00, stream_id=0> | |
(niv=3) | |
[SETTINGS_MAX_CONCURRENT_STREAMS(0x03):100] | |
[SETTINGS_INITIAL_WINDOW_SIZE(0x04):65535] | |
[SETTINGS_ENABLE_PUSH(0x02):0] | |
[ 0.567] send PRIORITY frame <length=5, flags=0x00, stream_id=3> | |
(dep_stream_id=0, weight=201, exclusive=0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appdirs==1.4.4 | |
attrs==21.4.0 | |
black==21.12b0 | |
cached-property==1.5.2 | |
certifi==2021.10.8 | |
cfgv==3.3.1 | |
chardet==4.0.0 | |
charset-normalizer==2.0.10 | |
click==8.0.3 | |
colorama==0.4.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% python -m cProfile -s cumtime -m sqlfluff.cli.commands lint ~/almanac.httparchive.org/sql/2019/performance/07_04d.sql | |
All Finished 📜 🎉! | |
3482273681 function calls (3476456236 primitive calls) in 3173.551 seconds | |
Ordered by: cumulative time | |
ncalls tottime percall cumtime percall filename:lineno(function) | |
514/1 0.009 0.000 3178.216 3178.216 {built-in method builtins.exec} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% python -m cProfile -s cumtime -m sqlfluff.cli.commands lint ~/almanac.httparchive.org/sql/2019/performance/07_04d.sql | |
All Finished 📜 🎉! | |
136753828 function calls (131426652 primitive calls) in 180.249 seconds | |
Ordered by: cumulative time | |
ncalls tottime percall cumtime percall filename:lineno(function) | |
513/1 0.023 0.000 182.282 182.282 {built-in method builtins.exec} | |
1 0.000 0.000 182.282 182.282 runpy.py:195(run_module) | |
1 0.000 0.000 179.557 179.557 runpy.py:62(_run_code) |
NewerOlder