-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improve kanban performances 3 #14764
Improve kanban performances 3 #14764
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
steps
data seems to have disappeared, is this intended?
No, it seems I've put in in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is hard to read, but it seems OK.
Code could probably be split into multiple functions (which could then be unit tested) but I wanted to keep things simple for a bugfixes PR. |
Following #14525 and #14599.
I've found another bottleneck that was slowing down the loading of the kanban page.
Each columns are loaded by an ajax request, which will find all the tickets of that column.
Then, for each tickets found, we load some extra data (actors and linked tickets).
This quickly become a costly operation as it require at least ~10 extra SQL requests for each ticket to load this extra data (so for 100 tickets, you run 1000 extra queries).
I've improved the performances massively by bulk loading all the extra data using a few SQL queries.
Then for each ticket we can just reach for the data in the preloaded arrays.
The small downside is that we use a bit more of memory but it seems reasonable (8mb for ~500 tickets).
If memory become a problem for massive databases (which would probably require ~30k open tickets to break a 256mb limit) , we can always split the process in X tickets batches.
Regarding the benchmark, I've used a test database with around 130k tickets.
Most tickets are closed, the biggest non-closed column had ~550 tickets:
Before the changes, the biggest column would take almost 2 seconds to load.
After the changes, it only take around 0.3 seconds.