#gocon Spring 2018 by Yuichi Watanabe @nulab
Yuichi Watanabe
# example endpoints
GET ***/info/refs?service=git-upload-pack
GET ***/info/refs?service=git-receive-pack
POST ***/git-upload-pack
POST ***/git-receive-pack
The Git Server basically implements behavior for each endpoint according to the Smart Protocol specification defined by Git.
Backlog has a subsystem that stood out a bit, a Git HTTP Server written in Perl. This Git HTTP Server itself does not undergo a lot of development. It's a relatively small system whose responsibility is not too large. I felt that the enthusiasm of maintaining this system within my team, including myself, was gradually decreasing. Also, we currently don't have a Perl Hacker our team.
At the same time, Backlog users are steadily increasing.
I thought I could improve our motivation, the maintainability, and performance by replacing the Git Server using Golang.
Don't guess, measure !
I decided to rewrite and measure it, as the proverb goes.
## It could handle many requests.
100ms
400ms
Golang
Perl
## It could handle many requests.
Perl
Golang
60%
100%
### CPU usage
## It could handle many requests.
Perl
Golang
### Load Average
The speed of git clone and push improved by 2x times.
The larger the Git repository, the larger the speed difference.
## Improved the user experience of clone
Perl | Golang |
---|---|
1:02.35 | 35.185 |
1:05.73 | 36.318 |
1:13.02 | 35.383 |
## And More...
> Perl: 2.082456 MB
> Golang: 24.664 KB
As a result, The performance improved. However, It's difficult to compare Perl and Golang, as they are so different. Golang is a compiled language and has lightweight threading.
I got a lot of insight on the design of Web applications written in Perl and eventually learned a lot about the Perl programming language.
I saw Geek 's wonderful hack footprints, I've come to like Perl than before.
Thank you for Perl, for your hard work. Hello Golang.