0

We have integrated Twilio Chat in Angular 7 applications with Angular Material and now having issues with performance (app freezes, slow animations) on first load (about 10s).

It's strongly depends on number of channels current user has. Currently it's about 70.

Twilio Chat installed using npm from https://www.npmjs.com/package/twilio-chat.

Does anyone experienced the same issue and found any feasible solution?

UPDATE

Tried with a new client which has only one channels and performance is good. But with the client which has about 151 channels still see performance issues.

vvahans
  • 1,849
  • 21
  • 29
  • Are you trying to load all the messages for those 151 channels on load of the application? If so, I can't imagine trying to do that without performance issues. I'd recommend you just load one visible channel and then fetch the channel descriptors for the other channels. You could then fetch other channels using something like [`requestIdleCallback`](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback) or web workers so as not to fill up the main thread with work. – philnash Apr 08 '19 at 04:45
  • @philnash anyways performance goes crazy because of so many async/sync tasks going on underneath the Twilio JS SDK. So even initializing it after the load of application, will slow down any animation during fetch of the channels. Currently I working on solution moving the Twilio Client initialization outside of Angular's zone. This way everything goes smoothly, downside is that I will need to manage all change detection by myself. When done will update with more details. – vvahans Apr 08 '19 at 09:39

0 Answers0