Home / Companies / GitHub / Blog / Post Details
Content Deep Dive

Improving Git push times through faster server side hooks

Blog post from GitHub

Post Details
Company
Date Published
Author
Carlos Martín Nieto, Thomas Gummerer
Word Count
1,098
Language
English
Hacker News Points
-
Summary

GitHub significantly improved the performance of their pre-receive hooks, which run during every Git push operation, by rewriting them from Ruby to Go. Originally implemented in 2013 within a Ruby on Rails application, the hooks had accumulated numerous dependencies over time, causing slow startup times that affected user experience. Despite attempts to optimize within the existing framework, a more substantial improvement was achieved by extracting and rewriting the hooks in Go, reducing the median execution time from 880 milliseconds to just 10 milliseconds. This rewrite not only enhances user experience by speeding up push operations but also represents an architectural shift towards a more efficient service design. The change has been successfully implemented on GitHub's main platform and in GitHub Enterprise Server 3.4, reflecting both a technical and user-focused priority.