I should back up and say the reason of the slowness is from the deploy key settings. There are 345 keys from which we check whether the user has permission to see the project:
I suggest moving the "Deploy Keys" section to the bottom of the Settings > Repository page, and loading the actual contents of that section asynchronously, showing a spinner until it's loaded.
I don't think it technically is a regression, because there used to be no Settings > Repository page at all, and Settings > Deploy Keys had always been this slow. The issue now just moved to a potentially more visible place.
I'm going to leave the scheduling decision to @mydigitalself .
Stan Huchanged title from Performance issues with Projects::Settings::RepositoryController in 9.0 to Deploy keys slow to loading of project settings for 9.0
changed title from Performance issues with Projects::Settings::RepositoryController in 9.0 to Deploy keys slow to loading of project settings for 9.0
Stan Huchanged title from Deploy keys slow to loading of project settings for 9.0 to Deploy keys slow loading of project settings for 9.0
changed title from Deploy keys slow to loading of project settings for 9.0 to Deploy keys slow loading of project settings for 9.0
@jarka I basically need to be able to replace that deploy keys section with JSON. So that I can use Vue to add it in. If we can paginate that would be cool too.
I'm assuming that pulling all the deploy keys across multiple projects is what takes the most time, that would probably mean, regardless of pagination, the request may still take a very long time @jarka ?
Is there a way we can be clever about this with a bit of UX and "paginate" or retrieve the keys by group to speed this up?
Create an end-point that returns json so that we can load these keys asynchronously
Optimise that end-point - here I see multiple options - after a quick look I think there are queries that are not needed or we could check permissions in a bit smarter way (keys across multiple projects) but need to look into it more.
I'd start with the json end point so that @jschatz1 can do the FE part and then will try to optimise it.