nuxt / scripts

Plug-and-play script optimization for Nuxt applications. (Public Preview)
https://scripts.nuxt.com
MIT License
120 stars 7 forks source link

Facade Script Benchmarks #79

Open harlan-zw opened 2 weeks ago

harlan-zw commented 2 weeks ago

We're advertising benchmarks for facade scripts on the home page, while we preface this data as inaccurate there is some opportunity to make this slightly more accurate.

image

We should avoid claiming the data as accurate as every site/page may have different benchmarks.

URLs

Google Maps

YouTube

Vimeo

Aareksio commented 6 days ago

I find the benchmarks very misleading. Technicalities aside, the Nuxt Script demo URLs offer different experience from their Default counterparts. Lazy loading scripts is a trade and should be treated as such.

harlan-zw commented 6 days ago

I find the benchmarks very misleading. Technicalities aside, the Nuxt Script demo URLs offer different experience from their Default counterparts. Lazy loading scripts is a trade and should be treated as such.

Thanks for the feedback. Do you have any suggestions to make this clearer?

The benchmarks are for showcasing the benefits of offering a different experience, Facade components explicitly (as it mentions).

The only way to provide a performance optimized loading experience is to offer a different experience (as far as I'm aware).

Aareksio commented 5 days ago

Current benchmark is confusing - I did not notice the "facade components" in copy on the left. Nor understood what it really means (loading script vs not loading script aka 0ms). It made me think Nuxt Scripts does something similar to partytown. I also instinctively extrapolated the examples to other scripts - eg. analytics, ads - which won't benefit from facade components at all.

I can not imagine a path to making "Mastering Web Vitals" clearer, while focusing on facade components. This is a valid approach, my concern is that placing it prominently as 2nd section and first bullet point on landing page gives incorrect impression of what the module is actually doing.

There are benefits Nuxt Scripts provides: local bundling, optimized loading waterfall, SSR proxy. None of them alters the experience significantly. If for marketing reasons the focus is supposed to be on Web Vitals, optimized waterfall alone should do the trick for many benchmarks (FCP, LCP, INP and FID).


Also worth considering is the fact the benchmarks are going to be inherently misleading, no matter how you do them. You are measuring a single script in void. The "46.4x faster" label reminds me of vite vs whatever vercel thing was and hot reload. If this is dictated by marketing - keeping it is fine, business is business.

harlan-zw commented 5 days ago

Thank you for the feedback, I'll make sure this is taken care of before we have an official announcement.

The point of the benchmarks is simply to show that using the Facade components will significantly improve your web vitals.

I intentionally don't have benchmarks for non-facade scripts as the benchmarking for them is too difficult to get anything accurate that I'd be happy to show-off, we'd need real-world data.

Final point I'll mention is the home page is not finished, I've just been chipping away at it on sections that interest me when I have the time available. I don't think this would be the second item when the page is finished.