Readit News logoReadit News
tunetheweb commented on Critical Resources and the First 14 KB (2022)   tunetheweb.com/blog/criti... · Posted by u/tosh
aidenn0 · a year ago
It took almost a second for me; I used devtools and it was about 200ms total for connection/TLS/download of the HTML (which is in fact under 14k (a bit over 35k uncompressed)). But then none of the assets (including the stylesheet) were queued for download until after 900ms. Does it really take 700ms to decompress and parse ~35k of HTML?
tunetheweb · a year ago
Site owner here! Even if it did take that long, browsers are clever enough not to wait until all the HTML is fetched as HTML can be processed in a streaming fashion. You can see here that stylesheets https://www.webpagetest.org/customWaterfall.php?test=240913_... are requested from the first bunch of HTML.

A second is little disappointing, but in fairness my lowly, single CPU, single core server with only 1 GB of RAM (a t2.micro server on AWS) was struggling a little with the load that Hacker News sent to it yesterday (16,000 page views in a day compared to about a third of that number for the whole month before that!). Plus the images on this page are a particularly big (because they are quite detailed so can't compress them more without losing that detail). So it was probably a bit slower than usual. At the minute everything is served from that one server (no CDN either at the mo - I really should stick it behind Cloudflare). It was a little play thing for me to test stuff out with, that became an occasional blog too on the side.

tunetheweb commented on 2022 Web Almanac   almanac.httparchive.org/e... · Posted by u/tunetheweb
tunetheweb · 3 years ago
2022 edition of the Web Almanac (HTTP Archive’s annual state of the web report) has just been released.
tunetheweb commented on Sqlfluff the SQL Linter for Humans   sqlfluff.com/... · Posted by u/rbanffy
fuckthemachine · 4 years ago
Is there a vim plugin for this yet? :)
tunetheweb commented on Sqlfluff the SQL Linter for Humans   sqlfluff.com/... · Posted by u/rbanffy
ThePadawan · 4 years ago
This is a linter which complains about spaces and newlines, but lets "WHERE col = NULL" pass (which can never be meaningful) just fine?

Obviously this depends on the rules configuration, but just judging that first smell test, it seems very ill thought out.

tunetheweb · 4 years ago
Seems like a good thing to check for! So we added a rule for this: https://github.com/sqlfluff/sqlfluff/pull/1527

Including autofixing if wanted.

Will be in the next release.

tunetheweb commented on Sqlfluff the SQL Linter for Humans   sqlfluff.com/... · Posted by u/rbanffy
munro · 4 years ago
The code looks really great [1], very declarative, looks like it should be pretty easy to add better PostgreSQL support. I also wonder if how easy it would be to plug it into VS Code, and build in an auto formatter (♥ω♥ ). At a glance it looks like it's parsing AST, which is really hard to find for SQL, so auto formatter could be possible to build from this. I notice SQLite could use some improving too, seems like a great project to coalesce around.

[1] https://github.com/sqlfluff/sqlfluff/blob/main/src/sqlfluff/...

tunetheweb commented on Sqlfluff the SQL Linter for Humans   sqlfluff.com/... · Posted by u/rbanffy
ErunamoJAZZ · 4 years ago
I wanted to use this linter, but they don't support many things that are used in real production code. By example, a simple postgres function like this one can't be parsed:

  CREATE OR REPLACE FUNCTION public.setof_test()
   RETURNS SETOF text
   LANGUAGE sql
   STABLE STRICT
  AS $function$
    select unnest(array['hi', 'test'])
  $function$
  ;

tunetheweb · 4 years ago
Looks like we didn't support SETOF.

Added this here: https://github.com/sqlfluff/sqlfluff/pull/1522

Demonstrating how easy it is to add this sort of thing to the project thanks to how the code is structured! :-)

u/tunetheweb

KarmaCake day89March 26, 2018View Original