Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/employee/employee-view/ is slow to load as it verifies the existence of the profile pictures #475

Open
federoitman opened this issue Jan 27, 2025 · 2 comments

Comments

@federoitman
Copy link

Bug Report

Description

/employee/employee-view/ takes a load time to load, specially if you use s3 for storage of profile pictures.
A lot of time is spent of the get_avatars method
https://github.com/horilla-opensource/horilla/blob/master/employee/models.py#L207-L218

Steps to Reproduce

  1. Load 100 employees with their respective profile pictures
  2. Go to /employee/employee-view/
  3. Measure the time it takes to load

Expected Behavior

/employee/employee-view/ loads fast

Actual Behavior

/employee/employee-view/ takes a long time to load

Screenshots

Image

Environment

  • Latest dev on docker-compose

Possible Solution

Avoid validating the existence of the files and resolve a 404 for the profile picture in the browser

@horilla-opensource
Copy link
Owner

Hi @federoitman ,

Thank you for reporting the issue. We appreciate your detailed description of the problem.

After reviewing the situation, it seems the load time is impacted by the size of profile pictures, especially when using S3 for storage. We plan to address this by updating the file upload operation. Moving forward, we will compress the file before saving it, which should help reduce load times and improve overall performance.

In the meantime, large file sizes may continue to cause delays in page loading, but this improvement should help resolve the issue.

Thanks again for bringing this to our attention. We’ll keep you updated on the progress of this fix!

Best Regards,
Team Horilla

@federoitman
Copy link
Author

I believe it's not only related to the file size. Checking that the files exists in s3 imply hundreds of api calls from the backend to aws before loading the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants