microsoftgraph / microsoft-graph-toolkit

Authentication Providers and UI components for Microsoft Graph 🦒
https://docs.microsoft.com/graph/toolkit/overview
Other
953 stars 306 forks source link

[BUG] mgt-person-card takes a long time to open in MGT 4.2.3 #3260

Closed Rafaelki closed 3 months ago

Rafaelki commented 3 months ago

Describe the bug From the moment the user clicks on the person to when the person card opens, there is a delay of almost 3 seconds, whereas in version 4.0.1 it was only 300ms. It works fine after the first time.

To Reproduce Steps to reproduce the behavior:

  1. Go to MGT playground
  2. Click on the second person
  3. Note the long delay.

Expected behavior The performance should match that of the previous versions. A 3-second delay to open a callout is excessive; it would be better to open it while other calls are being made, instead of waiting to have all the data before opening it.

Screenshots V4.2.3 image

V4.0.1 image

Environment (please complete the following information):

Additional context Add any other context about the problem here.

musale commented 3 months ago

Initial checks seem to point to batch requests taking ~1.2s to complete. Recurring batch requests are shorter ~700ms. I implemented some caching and seemed to work on 2 reasons:

Concerns:

Mnickii commented 3 months ago

@musale since data in sections like profile and direct reports might not change as dynamically as say in messages, I think polling on more dynamic data like messages, maybe even files would be better

musale commented 3 months ago

I think that's an improvement we can do with something like SharedWorkers api so that we don't have to re-render/obstruct normal browser usage.