Berkeley-CS61B / simple-office-hours-queue

Simple Office Hours Queue (SOHQ) is an open source online queue where students can request help and staff members can manage their office hours.
https://oh.datastructur.es
13 stars 7 forks source link

Optimize speed #13

Open MeshanKhosla opened 2 years ago

MeshanKhosla commented 2 years ago

Running npm run build shows a lot of red. We should use an analysis package to figure out where the issues are. We should also be using dynamic imports

This isn't an issue that has a clear end goal, just a progressive improvement in speed is the goal. Note that when you open the hosted version of SOHQ, it will take a second to start up. This isn't something we can fix, it's just a result of the cold starts in serverless infrastructure

MeshanKhosla commented 2 years ago

Added some code splitting here, build still isn't great https://github.com/MeshanKhosla/simple-office-hours-queue/commit/5c11ab24b3c99ece49e91a55e3f1dda41b670b6e

image

The size reduced significantly but the first load didn't

MeshanKhosla commented 2 years ago

Had to remove dynamic import from [id].tsx because of https://github.com/MeshanKhosla/simple-office-hours-queue/issues/15 but I should revisit with Suspense

MeshanKhosla commented 2 years ago

In general speed terms, we should also look into optimistic updates.

Hopefully upgrading the Next.js 13 in the future will allow faster runtimes, but we probably won't do this for some time.

MeshanKhosla commented 2 years ago

https://github.com/Berkeley-CS61B/simple-office-hours-queue/commit/9849b2cd813816805a8ad2fecd0273b430ae569f added optimistic updates for chat messages