Projects::MergeRequests::ContentController: widget.json is slow
Motivated by the RoR performance training, I wanted to do a bit of profiling:
This graph shows the total time spent in the top10 controller actions on GitLab.com (if my understanding is correct).
From this, it's clear that we spend most of time typically in Projects::MergeRequests::ContentController
rendering widget.json
: https://gitlab.com/gitlab-org/gitlab/blob/master/app/controllers/projects/merge_requests/content_controller.rb#L16
This contains the data for the merge request page that is being polled regularly in the background. An example is this request (it takes about 1.1s):
GET https://gitlab.com/gitlab-org/gitlab/-/merge_requests/22808/widget.json
The resulting JSON is currently around 61 kb in size.
The request rate fluctuates throughout the day. During the busiest hours this is at around 300 requests per second.