Watchers pop up window appears after a long time
|Assignee:||Marius BALTEANU||% Done:|
patch #33329 introduces a performance issue
When you want to add a watcher to an issue in a project with many collaborators, the pop-up window take between 10 sec and 20 sec (according to the number of collaborators) to appear.
It's very disturbing because user has no graphical indication about that.
#5 Updated by Simon Hori 28 days ago
Thank you for the patch #33329 that is good improvement for sure.
But we do have the same perfomance problem with 1300+ users.
watchable_object.visible?(user)is making at least two SQL queries per user.
I don't think we need all users names listed when the search query is blank. so I would like to request option 4.
As a test, I made this change and it reduced loading time from 4 sec to 0.2 sec.
- scope = @project.principals.assignable_watchers + scope = @project.principals.assignable_watchers.limit(100)