Lazy load commit data
What does this MR do and why?
Currently, when viewing a repository with many entries the page becomes very unresponsive and eventually freezes.
This MR adds functionality to lazy load commit data which significantly reduces the load on the frontend and backend.
Context
On the repository file browser, we make two types of requests to populate the table:
- Request 1: The files (file names) that populate the table.
- Request 2: The commit data (Last commit, Last update) associated with each file, we request this data in batches of 25.
This MR intends the optimize Request 2 by lazy loading the data instead of loading commit data for all of the files that have been requested in Request 1.
Screenshots or screen recordings
Before | After |
---|---|
Pages with many entries takes long to load and eventually freezes the browser | Page with many entries lazy loads commit data and remains interactive |
before | after |
How to set up and validate locally
Example below:
- Enable the lazy load feature flag
Feature.enable(:lazy_load_commits)
- Visit a page with many entries
- Notice how the commit data is lazy loaded and the page remains interactive.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #337226 (closed)
Edited by Jacques Erasmus