BioDrop icon indicating copy to clipboard operation
BioDrop copied to clipboard

#2640 Improve efficiency of profile loading code

Open yashdev9274 opened this issue 2 years ago • 2 comments

Used the 'async' and 'await' keywords, as well as the 'fs.promises' API, can improve the efficiency of the code by allowing it to perform multiple operations concurrently, rather than waiting for each operation to finish before starting the next one. This can result in faster execution times and reduced server load.

Fixes Issue

Fixed issue #2640

Changes proposed

Check List (Check all the applicable boxes)

  • [x] My code follows the code style of this project.
  • [ ] My change requires changes to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] All new and existing tests passed.
  • [x] This PR does not contain plagiarized content.
  • [x] The title of my pull request is a short description of the requested changes.

Screenshots

image

Note to reviewers

Additionally, I have used pagination or filtering to limit the number of documents retrieved from the Profile collection can also improve efficiency by reducing the amount of data that needs to be processed.

Finally, wrapping the JSON.parse function in a try-catch block can help handle any errors that might occur during parsing, which can help improve the reliability and robustness of the code.

yashdev9274 avatar Jan 04 '23 05:01 yashdev9274

Welcome @yashdev9274! Thank you so much for your first pull request!

github-actions[bot] avatar Jan 04 '23 05:01 github-actions[bot]

Perhaps you should consider looking at other fs.* calls and update them to use fs.promises, not just the user api end-point

swiftugandan avatar Jan 08 '23 16:01 swiftugandan

@yashdev9274 thank you for your contribution and efforts, but I am going to close this pull request as I think it needs more thought around how we solve this issue

eddiejaoude avatar Jan 14 '23 12:01 eddiejaoude

@eddiejaoude thank you for your feedback, I'll be available for the discussion on respective issue , do let me know you views

yashdev9274 avatar Jan 16 '23 07:01 yashdev9274