responsible-ai-collaborative / aiid

The AI Incident Database seeks to identify, define, and catalog artificial intelligence incidents.
https://incidentdatabase.ai
Other
168 stars 35 forks source link

Reduce navigation latency / Improve pagespeed score #1011

Open cesarvarela opened 2 years ago

cesarvarela commented 2 years ago

I think the latency on some clicks has gone up. I am not sure whether this is an issue with the render or with the increasing size of the app. Either way, it is something that deserves a little thought.

One thing related to this is loading less data on the page creator scripts and moving most of the graphql queries to the page/template static query. This is one of Gatsby's best practices and something we are doing "wrong": https://www.gatsbyjs.com/docs/how-to/performance/improving-build-performance/#query-only-needed-fields-in-createpages

Gatsby has been warning us from some time about it:

5:26:46 PM: warning The size of at least one page context chunk exceeded 500kb, which could lead to degraded performance. Consider putting less data in the page context.
cesarvarela commented 2 years ago

It's funny that Google tells you that you have to "reduce the impact of third party code" while at the same time being the biggest offenders:

image

do as I say?

smcgregor commented 2 years ago

Not as I do. :)

I think Google wants us to migrate Analytics libraries, so maybe that would help?

cesarvarela commented 2 years ago

For future reference, these are the generated chunks, the biggest one is the md editor, but should only be loaded with the editing forms, and even then, gzipped is around 200k which is not that bad. Everything else is smaller.

image

cesarvarela commented 2 years ago

Not as I do. :)

I think Google wants us to migrate Analytics libraries, so maybe that would help?

I would try other things first, not sure if there is anything else as good as Google's

smcgregor commented 2 years ago

Google has a new library we are not using, that is the one they want us to use.

Nice tree map!