Skip to content

Bulk-render commit titles in the tree view to improve performance

Nick Thomas requested to merge (removed):43140-reduce-logs-tree-load into master

What does this MR do?

Improve the performance of the repository tree view page by bulk-rendering commit titles.

We're talking about pages like this: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/changelogs/unreleased

When viewing a directory (tree) in a repository, every object (tree, blob, or submodule) in that directory has the full title of the commit that last touched that object shown. These are loaded asynchronously, in batches of 25, and inserted into the DOM via javascript.

The commit titles are rendered one at a time, which results in N+1 SQL queries when the commit titles contain references to issues, merge requests, etc.

By introducing a Banzai::ObjectRenderer, all commits can be rendered at the same time, which reduces some of the costs of rendering.

Following benchmarking, this may allow us to load commit data in batches larger than 25. Increasing the batch size to 50 will halve the number of asynchronous HTTP requests made to complete the page, but will also allow the same Banzai::ObjectRenderer to process twice as many commits, enhancing the impact of this change.

What are the relevant issue numbers?

Does this MR meet the acceptance criteria?

Closes #43140 (closed)

Edited by Nick Thomas

Merge request reports