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

Edit Timesheet Pageload Performance #298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JeffDess
Copy link

@JeffDess JeffDess commented Sep 25, 2023

I've noticed a performance issue when loading the edit timesheet page, the request can become blocking if multiple users load the page simultaneously. It is more obvious when impersonating an admin account on a Redmine instance with lots of projects and users (see #242 for more details) . The slowdown comes from the project list being iterated in Ruby, then each members of each projects being added to a list then deduped.

The solution is to make a single SQL query to get the users by filtering them by their projects (listed in the members table). That doesn't require looping through a large list and it has proven to be much more efficient. From the benchmark I've run on my production environment, pageload went from 4000~6000ms to 500~800ms, the SQL query being < 10ms.

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

Successfully merging this pull request may close these issues.

1 participant