News for hackers. Stuff that matters.
Re:How a fix in Go 1.9 sped up our Gitaly service by 30x by CapacitorSet on Thursday January 25, 2018 @07:24PM (#16236071)
I wonder how much it would speed up if they were using libgit2 directly.
Re:How a fix in Go 1.9 sped up our Gitaly service by 30x by jacobvosmaer on Friday January 26, 2018 @05:40AM (#16238212)
I'm on the Gitaly team.

As zegerjan wrote, Gitaly is a Go/Ruby hybrid.

The main Go process doesn't use libgit2 (for now) because we didn't want to have to deal with cgo. We already know how to deal with C extensions in Ruby, and we have a lot of existing Ruby application code that uses libgit2, so we still use it there. And that code works fine so I don't see us removing it.

In practice, sometimes spawning a Git process is faster than using libgit2, so why then not do that. Also for parts of our workload (handling Git push/pull operations), spawning a one-off process (git-upload-pack) is the most boring / tried-and-true approach.

Re:How a fix in Go 1.9 sped up our Gitaly service by 30x by sytse on Thursday January 25, 2018 @09:43PM (#16236651)
I'm at GitLab but not on the Gitaly team. I think we are using libgit2 but that it doesn't contain all the calls we need.
Re:How a fix in Go 1.9 sped up our Gitaly service by 30x by CapacitorSet on Thursday January 25, 2018 @11:17PM (#16236997)
Reading through an old issue (can't link right now, am on mobile), it seems that the main reason for not using libgit2 in Gitaly is performance, since it would read too many unused files.
Re:How a fix in Go 1.9 sped up our Gitaly service by 30x by zegerjan on Friday January 26, 2018 @03:18AM (#16237711)
The Gitaly server has a Ruby component, but also a Go component. The Ruby server uses Rugged[1] and Gollum-lib[2] which both use libgit2.

The Go component doesn't have libgit2 binding yet, although we're looking into adding that later. That or maybe go-git[3]. But for now Gitaly is mainly focussed at migrating all git calls from the Rails monolith. Not introducing a new component now reduces the risks this project has.

[1]: https://github.com/libgit2/rugged/ [2]: https://gitlab.slack.com/archives/C027N716H/p151695430400026... [3]: https://github.com/src-d/go-git/

Re:How a fix in Go 1.9 sped up our Gitaly service by 30x by masklinn on Friday January 26, 2018 @04:09AM (#16237868)
Assuming they're currently pure git, binding to libgit2 would require using cgo, which could have far-ranging (negative) consequences.
Re:How a fix in Go 1.9 sped up our Gitaly service by 30x by chriscool on Friday January 26, 2018 @03:44AM (#16237796)
libgit2 has had bugs related to file locking (for example when you make some ref changes while garbage collecting) and libgit2 does not implement all the git features, so you cannot do everything using libgit2 anyway.