le-git-graph icon indicating copy to clipboard operation
le-git-graph copied to clipboard

Loading too slow if too many branches

Open NirmalScaria opened this issue 2 years ago • 2 comments

Describe the bug If the repository contains too many branches, the first loading of commits tab takes too long. This is particularly visible if the number of branches is greater than 100, since that would mean waiting for another GraphQL request.

To Reproduce Steps to reproduce the behavior:

  1. Go to a repo with too many branches. ( https://github.com/flutter/flutter is a good example )
  2. Click on "Commits" tab (added by the extension)
  3. See error

Expected behavior The loading should be way faster than this.

Screenshots NA

Version information:

  • OS: MacOS 13.0
  • Browser: Chrome
  • Version: 110.0.5481.177 (Official Build) (arm64)
  • Repository where this issue was observed: https://github.com/flutter/flutter

Additional context This was known during the development times itself, and had no other option. There is no API from github that lists commits across all branches sorted by commit date. Either that, or an API that lists branches sorted by head commit date could solve this problem. AFAIK, neither exists and a fresh solution would be required.

NirmalScaria avatar Mar 02 '23 05:03 NirmalScaria

I stumbled on this issue with https://github.com/mongodb/mongo today. For that repository loading never finishes at all. In fact it does not make sense to analyze all branches by default when there are dozens of them. Can we have option to only analyze currently selected branch?

igorsol avatar Mar 20 '25 15:03 igorsol

The issue is a direct result of the restriction of GitHub API that pagination allows maximum of 100 items per request.

Regarding your new proposal for only showing currently selected branch: There is no concept of currently selected branch before the page actually loads. But it is possible to make an extra option. If the pagination is taking too long, show an indication "There are too many branches" and a button "Show filtered branches instead". Upon clicking, the user could see the list of branches, select only the ones they need, and proceed, so as to show the selected branch commits only.

I will keep this issue open for now, for anyone who will be interested in implementing the feature.

NirmalScaria avatar Mar 25 '25 07:03 NirmalScaria