BioDrop icon indicating copy to clipboard operation
BioDrop copied to clipboard

[FEATURE] Performance improvements to the profile page

Open eddiejaoude opened this issue 3 years ago • 8 comments

Description

I think there are various performance improvements we can make to the LinkFree app, but this issue is focusing on the profile page

Currently this is the workflow of the file and I think some could be off-loaded to a serverless function as to be non-blocking for the page to return the data?

  1. load json file
  2. load profile
  3. increment profile counter
  4. increment app total profile view counter
  5. increment profile counter for that date
  6. check for location, and fetch if cache expired

I think we need steps 1, 2 and 6, can steps 3, 4 and 5 be done async and not effect the page load time?

API file pages/api/profiles/[username]/index.js https://github.com/EddieHubCommunity/LinkFree/blob/main/pages/api/profiles/%5Busername%5D/index.js

Screenshots

No response

Additional information

No response

eddiejaoude avatar Apr 26 '23 11:04 eddiejaoude

To reduce notifications, issues are locked until they are ready for dev and to be assigned

github-actions[bot] avatar Apr 26 '23 11:04 github-actions[bot]

@eddiejaoude Hello sir can you elaborate this issue

Bharadwajshivam28 avatar May 02 '23 16:05 Bharadwajshivam28

@Bharadwajshivam28 I have added some more information to the issue description

eddiejaoude avatar May 03 '23 03:05 eddiejaoude

@Bharadwajshivam28 I have added some more information to the issue description

Okay sir i will check it

Bharadwajshivam28 avatar May 03 '23 04:05 Bharadwajshivam28

users Api route has been renamed to profiles

The new api route and files are

pages/api/profiles/[username]/index.js https://github.com/EddieHubCommunity/LinkFree/blob/main/pages/api/profiles/%5Busername%5D/index.js

ChinmayMhatre avatar Jun 12 '23 09:06 ChinmayMhatre

@eddiejaoude This queuing of operations to be done in async manner and having to wait for only those which are really needed to feed the data to FE - sounds great and will have lot of improvement in the response time.

Apart from this, I'm not really familiar with the existing implementation, But, loading the profile page is something we would have the most/frequent requests for in the system. I would suggest to have the profiles data to be maintained and fetched from in-memory/cache storage first on profile load request (preferably Redis).

It might require major changes at the BE to manage data in Redis and maybe some server cost as well 😅, but, we will have significant improvement in profile load. Maybe we can try out a POC around this and benchmark the performance.

daxitpatel avatar Jun 16 '23 09:06 daxitpatel

@daxitpatel thank you for your suggestion, but this issue is not about reads it is about writes, wherever we read the data from we still need to write otherwise the stats will not be recorded

eddiejaoude avatar Jun 18 '23 03:06 eddiejaoude

As there have already been small improvements to this I will close for now.

SaraJaoude avatar Sep 30 '23 17:09 SaraJaoude