Skip to content

Reduce number of gitaly calls in Snippet REST list endpoints

What does this MR do?

At the moment, when we query the REST endpoint /api/:version/snippets/public, in p95 200 Gitaly calls are made. Since we're retrieving 20 snippets per page, it's like 10 Gitaly calls per snippet, which is a lot.

Locally, I haven't seen that many, but I spotted something we can improve.

Instead of calling the Gitaly RPC ListFiles twice, we can just call it once and store the result to reuse it later.

Does this MR meet the acceptance criteria?

Conformity

Edited by Francisco Javier López

Merge request reports

Loading