-
- Downloads
Merge branch 'use-git-branch-merged' into 'master'
Fetch the merged branches at once. Checking it one by one in the view. We don't cache this yet because this would already much improve the performance. A naive test against a particularly large repository: ``` ruby begin now = Time.now branches.map{ |b| r.merged_to_root_ref?(b.name) } Time.now - now end # 8.265830782 ``` Around 10 times faster: ``` ruby begin now = Time.now r.merged_branches(branches.map(&:name)) Time.now - now end # 0.807405397 ``` This should make the branches page usable. See merge request gitlab-org/gitlab-ce!14729
Showing
- app/controllers/projects/branches_controller.rb 2 additions, 0 deletionsapp/controllers/projects/branches_controller.rb
- app/models/repository.rb 15 additions, 6 deletionsapp/models/repository.rb
- app/views/projects/branches/_branch.html.haml 3 additions, 2 deletionsapp/views/projects/branches/_branch.html.haml
- app/views/projects/branches/index.html.haml 1 addition, 1 deletionapp/views/projects/branches/index.html.haml
- changelogs/unreleased/use-git-branch-merged.yml 5 additions, 0 deletionschangelogs/unreleased/use-git-branch-merged.yml
- lib/gitlab/git/branch.rb 8 additions, 0 deletionslib/gitlab/git/branch.rb
- lib/gitlab/git/repository.rb 11 additions, 0 deletionslib/gitlab/git/repository.rb
- spec/lib/gitlab/git/branch_spec.rb 32 additions, 0 deletionsspec/lib/gitlab/git/branch_spec.rb
- spec/lib/gitlab/git/repository_spec.rb 26 additions, 0 deletionsspec/lib/gitlab/git/repository_spec.rb
- spec/models/repository_spec.rb 18 additions, 0 deletionsspec/models/repository_spec.rb
Loading
Please register or sign in to comment