Ideas for Improving Performance #8682
Replies: 9 comments 9 replies
-
OPcache should be enabled by default |
Beta Was this translation helpful? Give feedback.
-
Wow, this is a really great write up. Thanks for this! 🎉 🙏 React Router Data LoadingI think this is something we could start right away and would help us a lot! Though, this would mean transitioning to loaders. I was able to adapt the example they provide, which uses Server-side rendering (SSR)I think SPA has served us well in getting things up and running in absence of a nodejs server. However, now as we start to scale and promote the site publicly, we should seriously consider moving to SSR for all the reasons you stated. Again, this will be a massive project however, we are well positioned to do this behind the scenes since we are leveraging workspaces. I imagine we could slowly replicate existing functionality in a different workspace under Now, when it comes to choosing a framework, I am partial to remix having used it in the past. Thought, nextjs has a much larger community behind it. My reasons for preferring remix are:
Static Site Generation (SSG)I'm wondering, if we find that SSG is better for mainly static pages could we do a mixed approach where we have a very tiny app that only contains static pages? 🤔 Client-side Caching
Our spinners are out of control 🤣 . I think if we implement the lazy routes, we can hopefully reduce them since we can start fetching data before we request the actual page component. HTTP Caching (of pages)This would be nice to get in! Caching GraphQL
I would say we should go ahead and stick this on our more static resources (skills, skill families, departments, etc.) right away 😅 HTTP Caching for GraphQL
Oh, this is neat! I was worried that Optimistic UpdatesHopefully at some point someone can look at getting the graphcache working with
I think we should look into zod if we want to strengthen our validation. It does work with
Hopefully our server isn't too far behind the client so popping a toast on a delay wouldn't be that noticeable 🤷♀️ . |
Beta Was this translation helpful? Give feedback.
-
I agree with everything written so far! A couple of words of caution though:
|
Beta Was this translation helpful? Give feedback.
-
Questions:
Server Side Rendering
Optimistic Updates
Actual Performance vs Perceived Performance
|
Beta Was this translation helpful? Give feedback.
-
What do we know now?
What are we missing?
|
Beta Was this translation helpful? Give feedback.
-
Next steps
|
Beta Was this translation helpful? Give feedback.
-
There was some discussion about how to handle our existing forms. Looks like there is a library to integrate it with |
Beta Was this translation helpful? Give feedback.
-
What about switching from webpack to vite for better performance? @esizer has already started work on a branch and there is already an issue for it, so what's holding it up? |
Beta Was this translation helpful? Give feedback.
-
Was interested in this so I ran lighthouse again now that we have vite in prod. It came back with some interesting insights that might be easy wins for us. Reduce JavascriptSeems like tiptap is loading all the time regardless of whether it is in use or not. Wondering if we can determine why. We could see about lazy loading it? 🤔 Render-blocking resourcesThere are two things of note in here:
CSS sizeThis is one of the first blocking resoucrces (after html itself) so it is quite important to make reductions where possible. From what I can see, most of the bloat is coming from two main areas: The following rules The selectors themselves are causing alot of bloat. We have a selector that is 720bytes 🤯 and many others that are in the 200byte range. // This is 720b of data to set a background color :grimacing:
[data-h2*=dark] [data-h2-background-color*="base:all:focus-visible:children[>span:first-child](focus)"]:focus-visible>span:first-child:not([data-h2-background-color]),[data-h2*=dark] [data-h2-background-color*="base:all:focus-visible:children[.counter](focus)"]:focus-visible .counter:not([data-h2-background-color]),[data-h2*=dark] [data-h2-background-color*="base:all:focus-visible(focus)"]:focus-visible,[data-h2*=dark] [data-h2-background-color*="base:all:focus-visible:children[.Step__Icon](focus)"]:focus-visible .Step__Icon:not([data-h2-background-color]),[data-h2*=dark] [data-h2-background-color*="base:all:focus-visible:children[.Step__Flair](focus)"]:focus-visible .Step__Flair:not([data-h2-background-color]) HTTP/2We already have a ticket for this but just noting it. |
Beta Was this translation helpful? Give feedback.
-
React Router Data Loading
Server-side rendering (SSR)
Static Site Generation (SSG)
Client-side Caching
HTTP Caching (of pages)
If personal pages, like my profile or my experience, have a unique url, then they would be good candidates for this.Caching GraphQL
HTTP Caching for GraphQL
Optimistic Updates
Backend Performance
If the time spent on the server (between receiving a response and returning it) is longer (or comparable) to the time in transit, we should focus on improving the performance of the server itself. Server execution time can be divided into DB and PHP code.
DB performance improvements
If we are spending a lot of time on DB calls, we likely just have too many queries. We can try using
load
methods to aggregate queries. We should look into whether there are any specific queries which take a long time - if there are, I'm sure there are other SQL-specific ways to improve performance but I'm less familiar with them.An obvious place to look is whether we're indexing all the columns we're filtering on often.
If we are repeating the same queries a lot, we could also consider caching DB responses.
PHP performance improvements
We know that we've caused performance issues by running policy methods on each item returned by a list - particularly when the policy method itself triggered a DB query. This is the first place I'd look for improvements.
We could try caching the entire graphql response with
cache
directives. Especially makes sense for stuff likeskills
anddepartments
which change very rarely.Other
Beta Was this translation helpful? Give feedback.
All reactions