Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Refactor branch list using src-d/go-git and add GetRefs function #133

Merged
merged 6 commits into from
Nov 15, 2018
Merged

Refactor branch list using src-d/go-git and add GetRefs function #133

merged 6 commits into from
Nov 15, 2018

Conversation

lafriks
Copy link
Member

@lafriks lafriks commented Nov 11, 2018

GetRefs will be needed to implement Refs API

Add src-d/go-git dependency and refactored GetBranches to use this lib.

Old using git command:
BenchmarkRepository_GetBranches-4           1000           1505930 ns/op
New using src-d/go-git:
BenchmarkRepository_GetBranches-4          10000            150774 ns/op

@codecov-io
Copy link

codecov-io commented Nov 11, 2018

Codecov Report

Merging #133 into master will decrease coverage by 0.21%.
The diff coverage is 63.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #133      +/-   ##
==========================================
- Coverage   33.54%   33.33%   -0.22%     
==========================================
  Files          25       28       +3     
  Lines        1407     1761     +354     
==========================================
+ Hits          472      587     +115     
- Misses        862     1096     +234     
- Partials       73       78       +5
Impacted Files Coverage Δ
ref.go 0% <0%> (ø)
repo_branch.go 12.32% <58.33%> (+12.32%) ⬆️
repo_ref.go 70% <70%> (ø)
tree.go 68.42% <0%> (-6.58%) ⬇️
signature.go 64% <0%> (-6%) ⬇️
repo_tree.go 35.71% <0%> (-5.96%) ⬇️
tree_blob.go 40.54% <0%> (-4.63%) ⬇️
commit_info.go 63.92% <0%> (-4.08%) ⬇️
git.go 27.27% <0%> (-3.29%) ⬇️
parse.go 57.62% <0%> (-3.16%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3afe30...0b52498. Read the comment docs.

@lunny
Copy link
Member

lunny commented Nov 12, 2018

@lafriks the benchmark is for a bare git repository?

@lafriks
Copy link
Member Author

lafriks commented Nov 12, 2018

@lunny yes

@lunny
Copy link
Member

lunny commented Nov 12, 2018

It seems we only have a bare repo on testdata

@lafriks
Copy link
Member Author

lafriks commented Nov 12, 2018

@lunny is that a problem?

@lunny
Copy link
Member

lunny commented Nov 12, 2018

I prefer pure go library than git command. But for performance measure, I think a bare repo maybe not a good example.

@lafriks
Copy link
Member Author

lafriks commented Nov 12, 2018

We store all git repos as bare server-side so that is measurement most important for gitea case

@jonasfranz jonasfranz merged commit 578ad8f into go-gitea:master Nov 15, 2018
@lafriks lafriks deleted the feat/refs_gogit branch November 16, 2018 05:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants