rocky-linux / distrobuild

Distribution builder
MIT License
31 stars 5 forks source link

Performance woes #1

Open hbjydev opened 3 years ago

hbjydev commented 3 years ago

Trying to load the homepage takes around 30 seconds to first contentful paint. Is there a way we could speed this up?

mstg commented 3 years ago

I've been thinking about having a vendor bundle and a vendor CSS bundle so we don't have to reload everything each update. Although I want to add that the bundle is approx. 4MB and the servers are located in the US so the speeds are not that great for people located in Europe. We are also working on getting Distrobuild behind a CDN to speed things up.

hbjydev commented 3 years ago

Yeah, getting it behind a CDN will probably help some.

Did you configure tailwind to purge CSS? That probably shrinks the CSS by a little bit.

mstg commented 3 years ago

Yes, Tailwind is set to JIT mode so only the classes used are included in the stylesheet. Also thinking of adding lazy loading and tree shaking so we should be able to shrink the initial size considerably. CDN will probably solve most of our speed issues with static files though.

hbjydev commented 3 years ago

I didn't know Tailwind's JIT auto-purged, that's cool. I'm used to adding src/**/*.ts to the purge array in the tailwind config still

Tree shaking will be useful. I don't know how to do it on Webpack, I've only ever done it with Rollup and Parcel.

mstg commented 3 years ago

purge is actually set (https://github.com/rocky-linux/distrobuild/blob/main/ui/tailwind.config.js#L3) Together with mode: 'jit', both dev and prod stylesheets are identical which is quite nice. Optimizations will obviously not be prioritized right now, but I'll definitely come back to this.

NeilHanlon commented 3 years ago

I'd love to be able to cache CSS and JS between releases, where possible :D we'll get there