kodadot / nft-gallery

Generative Art Marketplace
https://koda.art
MIT License
634 stars 361 forks source link

Request heavy app - high amount of fetches #10416

Open exezbcz opened 4 months ago

exezbcz commented 4 months ago

@vikiival will comment on the most frontend-heavy features

Insane amount of fetches

I am not able to find the original issues but I have tried to load kodadot.xyz on uncached windows 10 PC (24 GB Ram, 8 core) with gigabit internet and this is what happened:

single-load

Single page load toook 6 min and 30 sec to finish.

That took 800 MB of data! and more than 3000! Reqests

Therefore would be optimal to find the source of this data overfetching :) as: more request == more compute == higher load -> slow app

Insane amount of requests / computation

is fetching a big chunk of data to process therefore if user clicks there the app will freeze

Therefore data optimization -> a.k.a do graphql resolvers is a way to go.

Originally posted by @vikiival in https://github.com/kodadot/nft-gallery/discussions/10370#discussioncomment-9676122

exezbcz commented 4 months ago

cc @hassnian

exezbcz commented 4 months ago

Single page load toook 6 min and 30 sec to finish.

That took 800 MB of data! and more than 3000! Reqests

oohh, I think this is from service workers. from this plugin: https://github.com/kodadot/nft-gallery/blob/main/plugins/pwa.client.ts. let's remove then?

SW will prefetch (non-blocking request) other assets in the background and put them in the cache, so the finish looks like it took longer to complete. Here is the page without cache and bypasses the service workers.

Screenshot 2024-06-06 at 22 50 51

But we can still improve the number of requests.

Originally posted by @preschian in https://github.com/kodadot/nft-gallery/discussions/10370#discussioncomment-9691758

exezbcz commented 4 months ago

have you found anything @hassnian