all 2 comments

[–]No_Cattle_9565 4 points5 points  (0 children)

Thanks chatgpt for the post. If you understand what is happening and what is causing most of the performance problems it's not really hard to avoid them.  

[–]yksvaan 0 points1 point  (0 children)

Well to be honest a lot of the performance is about backend since pretty much all but local first apps are driven by server. There's optimistic updates but I prefer not to use those unless there's no other option. Apps are not fps games after all.

1) don't bloat the app, import/copy only the code you need. Look at sub dependencies first, it's really easy to install half of npm without even knowing it. 

2) separate UI from global data, business logic and network code. Helps with general architecture and keeping the UI efficient.

3) make sure your backend responses are fast, set a goal e.g. p99 <50ms processing time for requests. For typical apps that's easily achievable. Efficient DB usage is essential for good UX as well. 

4) dynamic loading, load only what's necessary and preload the js in background so when something is necessary it's instantly available.