Git Core Improvements and Contributions
How we decreased GitLab repo backup times from 48 hours to 41 minutes

How we decreased GitLab repo backup times from 48 hours to 41 minutes

6/5/2025 · Karthik Nayak

What this post added

This post details a specific performance optimization contributed upstream to the Git project, addressing a bottleneck in `git bundle create`. The issue was an O(N^2) complexity in `object_array_remove_duplicates()` due to nested loops for duplicate reference handling. The fix replaces this with a map data structure, improving performance by up to 6x in benchmarks. This optimization was backported to GitLab for immediate customer benefit, reducing backup times for the largest repository from 48 hours to 41 minutes.

Read the original post ↗