HN user

igrigorik

5,399 karma

http://www.igvita.com/

[ my public key: https://keybase.io/igrigorik; my proof: https://keybase.io/igrigorik/sigs/eMcFb-lAFqkBGZKfdzJcQrC5a2dTBj_8cTAQqsXUhaE ]

Posts187
Comments208
View on HN
github.com 9mo ago

AgentBoard: A Switchboard for AI in the Browser

igrigorik
2pts0
webmasters.googleblog.com 8y ago

Using page speed in mobile search ranking

igrigorik
80pts37
blog.chromium.org 8y ago

Introducing the Chrome User Experience Report

igrigorik
3pts0
www.igvita.com 9y ago

Stop Cross-Site Timing Attacks with SameSite Cookies

igrigorik
4pts0
www.igvita.com 10y ago

Building Fast and Resilient Web Applications

igrigorik
1pts0
github.com 10y ago

Google/proto-quic is a standalone library for QUIC

igrigorik
49pts8
www.igvita.com 10y ago

Control Groups (cgroups) for the Web?

igrigorik
4pts0
www.smashingmagazine.com 10y ago

Preload API: What Is It Good For?

igrigorik
3pts0
www.igvita.com 10y ago

Don't lose user and app state, use Page Visibility

igrigorik
2pts0
developers.google.com 10y ago

Automating resource selection with Client Hints

igrigorik
3pts0
www.igvita.com 10y ago

Eliminating Roundtrips with Preconnect

igrigorik
9pts0
www.igvita.com 11y ago

Browser Progress Bar Is an Anti-Pattern

igrigorik
4pts0
shop.oreilly.com 11y ago

HTTP/2: A New Excerpt from High Performance Browser Networking

igrigorik
1pts0
chimera.labs.oreilly.com 11y ago

HTTP/2 (High Performance Browser Networking)

igrigorik
3pts0
www.igvita.com 11y ago

Fixing the 'Blank Text' Problem

igrigorik
2pts0
www.igvita.com 11y ago

Resilient Networking: Planning for Failure

igrigorik
3pts0
www.igvita.com 11y ago

Capability Reporting with Service Worker

igrigorik
10pts0
plus.google.com 11y ago

No need to wait for ServiceWorker – speed up your site today

igrigorik
21pts7
plus.google.com 11y ago

Reactive prefetch on Google Search: 100-150ms speedup

igrigorik
169pts90
www.igvita.com 11y ago

Extensible Web Resource Loading Manifesto

igrigorik
5pts0
www.igvita.com 11y ago

Optimizing Webfont Selection and Synthesis

igrigorik
1pts0
perf.fail 11y ago

Learning from Apple’s livestream perf fiasco

igrigorik
11pts0
igrigorik.github.io 12y ago

Resource Hints: preconnect, preload, prefetch, prerender

igrigorik
2pts0
www.igvita.com 12y ago

Script-injected "async scripts" considered harmful

igrigorik
235pts56
www.igvita.com 12y ago

Uplink Latency of WiFi and 4G Networks

igrigorik
4pts0
www.igvita.com 12y ago

Why is my CDN 'slow' for mobile clients?

igrigorik
4pts0
istlsfastyet.com 12y ago

Is TLS Fast Yet?

igrigorik
5pts0
www.igvita.com 12y ago

Optimizing Web Font Rendering Performance

igrigorik
3pts0
www.igvita.com 12y ago

Optimizing Nginx TLS Time To First Byte

igrigorik
131pts12
queue.acm.org 12y ago

Making the Web Faster with HTTP 2.0

igrigorik
5pts0

FWIW, think of SSR and RSC as complimentary. A tour that explores this: https://shopify.engineering/high-performance-hydrogen-powere...

The key to unlocking fast first-render is combination of streaming SSR (i.e. streaming HTML instead of just JS blobs), which is enabled by adopting Suspense (i.e. async the data fetch and stream data when available in HTML response, which then hydrates relevant component). RSC layers on top: it establishes a clear boundary between client and server logic, which enables better bundling strategies (as you highlighted), but also per-component and efficient subtree updates for subsequent interactions.

RSC is early but we've been working with the React core team on our use case and, based on the past few months of work and progress, we feel pretty confident about the direction. In particular, shifting legacy React apps towards Suspense+RSC will be a big shift for many, but we don't have that constraint.. We have the "luxury" of starting anew and we're leaning into the bleeding edge because it enables all the right primitives for commerce: fast first render, efficient updates, open space for optimizing bundles and RSC transport protocol, etc.

@cramforce nailed it. One thing I'll add.. I would strongly encourage everyone to collect "field" (real user measurement) data for each of these metrics via their own analytics, as that'll give you the most depth and flexibility in doing root cause analysis on where to improve, etc. The mentions of CrUX and other Google-powered tools are not to create any dependencies, but to help lower the entry bar for those that may not have RUM monitoring already, or will need some time to get that in place.. For those users, we offer aggregated insights and lab-simulations (Lighthouse) to get a quick pulse for these vitals.

Input delay is bad, period.

It's not a matter of first vs rest but observation that input while the page is loading is, often, where most of the egregious delays happen: the browser is busy parsing+executing oodles of script, sites don't chunk script execution and yield to the browser to process input, etc. As a result, we have FID, which is a diagnostic metric for this particular (painful) user experience problem on the web today.

Note that Event Timing API captures all input: https://github.com/WICG/event-timing. First input is just a special case we want to draw attention to due to the reasons I outlined above. That said, we encourage everyone to track all input delays on their site, and it's definitely a focus area for future versions of Core Web Vitals -- we want to make sure users have predictable, fast, response latency on the web.

I think you're misreading the copy: "PSI estimates this page requires 1 additional round trips to load render blocking resources and 0.0 MB to fully render. The median page requires 4 round trips and 2.7 MB. Fewer round trips and bytes results in faster pages."

The 2.7MB is a reference to the median.

Once again, I'm not arguing against SW.

We should be thinking about how to deliver the best of both worlds: a great experience for older (non-SW) browsers, and an even better experience for those that do. The underlying patterns are effectively the same, SW just makes many things much simpler, and there is no reason to block on SW to start on this path.

To be clear, my squabble is not an argument against SW in any way. SW affords a lot more control to the developer and makes this pattern significantly simpler to implement and deploy.

I'm simply pointing out that you can get most (if not all) of the claimed perf benefits using existing API's. Yes, it won't look as pretty, but if you want to deliver a better experience to existing + older browsers.. this is something to consider.

Actually, you're both right. With http/2 the server can push critical assets delivering similar results. But, that requires that the server supports http/2 and is smart enough to initiate the push, AND those resources are same-origin.

The benefit of above technique is that it's deployable today, doesn't require the destination server to be upgraded, and works for cross-origin resources.

No, HTTP/2 has no effect on this. The insight here is that we're initiating the fetch for the HTML and its critical resources in parallel... which requires that the page initiating the navigation knows which critical resources are being used on the target page.

Embracing HTTPS 12 years ago

For the record, it's worth noting that we're starting from a state that's nothing short of disastrous: https://alexgaynor.net/2014/nov/12/state-of-news-tls/

Let's hope that twelve months from now, we're looking at a very different landscape. Kudos to NYTimes for issuing the challenge. At the very least, this is an important conversation starter.

Unfortunately defer is broken in bunch of browsers - doesn't preserve order, etc. As a result, if you need to preserve order, you're better off with the async function queueing pattern.

Also, if you need to wait for DOM/CSSOM, then you can still use an async script and just install an event listener for DomContentLoaded / DomInteractive / etc., when it loads.

"Doesn't take up any real resources" is anything but true. An iframe in particular is basically a new render process, which adds a lot of overhead. Just because you've set "display:none" on an element doesn't mean it's free.

To clarify, both script-injected and regular <script> tags block on CSSOM: there is no difference there. Only the "async" attribute on script (i.e. <script async>) removes the dependency on CSSOM... which is why you should use it.

As for why the browser doesn't download the script-injected scripts: they're hidden inside of the inline script blocks. In order to figure out what you intend to do inside of that block, the browser would have to execute the JavaScript. The behavior that you want (download wait for CSSOM) is exactly what you get when you use regular blocking tags - those are discovered by the preloader and requests are dispatched. That's what the first and second diagram in the blog post illustrate.

If you want to initiate an early fetch, just put the <script async> tag at the top - you won't block DOM construction or block on CSSOM. If you need ordered execution, put your inline script block above CSS and add your logic there (but please keep it lean).