diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-10-13 16:05:06 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-10-20 09:11:34 +0300 |
commit | 8e2843ed4c4ac0e2f9b3c2738af5c2f44c0b8481 (patch) | |
tree | 33ee9e991a2e0e86a044448e612b37dee381a92f | |
parent | 490deda5e0c3b3f1476a13da2eeac2d46dfd71f6 (diff) |
blob: Avoid useless `CatfileInfo()` pipeline step
The ListLFSPointers RPC uses a three-level pipeline from `Revlist()` to
`CatfileInfo()` to `CatfileObject()`. The second step isn't needed
anymore though given that `Revlist()`'s iterator can now be directly
passed to the `CatfileObject()` pipeline step.
Get rid of the useless pipeline step and thus avoid spawning a catfile
process.
Changelog: performance
-rw-r--r-- | internal/gitaly/service/blob/lfs_pointers.go | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/internal/gitaly/service/blob/lfs_pointers.go b/internal/gitaly/service/blob/lfs_pointers.go index b33470b57..f7e37c80d 100644 --- a/internal/gitaly/service/blob/lfs_pointers.go +++ b/internal/gitaly/service/blob/lfs_pointers.go @@ -52,25 +52,17 @@ func (s *server) ListLFSPointers(in *gitalypb.ListLFSPointersRequest, stream git repo := s.localrepo(in.GetRepository()) - objectInfoReader, err := s.catfileCache.ObjectInfoReader(ctx, repo) - if err != nil { - return helper.ErrInternal(fmt.Errorf("creating object info reader: %w", err)) - } - objectReader, err := s.catfileCache.ObjectReader(ctx, repo) if err != nil { return helper.ErrInternal(fmt.Errorf("creating object reader: %w", err)) } - revlistOptions := []gitpipe.RevlistOption{ + revlistIter := gitpipe.Revlist(ctx, repo, in.GetRevisions(), gitpipe.WithObjects(), gitpipe.WithBlobLimit(lfsPointerMaxSize), gitpipe.WithObjectTypeFilter(gitpipe.ObjectTypeBlob), - } - - revlistIter := gitpipe.Revlist(ctx, repo, in.GetRevisions(), revlistOptions...) - catfileInfoIter := gitpipe.CatfileInfo(ctx, objectInfoReader, revlistIter) - catfileObjectIter := gitpipe.CatfileObject(ctx, objectReader, catfileInfoIter) + ) + catfileObjectIter := gitpipe.CatfileObject(ctx, objectReader, revlistIter) if err := sendLFSPointers(chunker, catfileObjectIter, int(in.Limit)); err != nil { return err |