In a recent blog post, Facebook's Durham Goode and Siddharth Agarwal explained how they modified the Mercurial version control system to meet their company's needs.
At issue was the vast size of Facebook's source code—"many times larger than even the Linux kernel, which checked in at 17 million lines of code and 44,000 files in 2013." The company decided to modify an existing version control system to enable better scalability, and they settled on Mercurial as the one that would work best for their purposes. Unfortunately, at that time, Mercurial wasn't as fast as Git as some other alternatives.
The team contributed more than 500 patches to Mercurial to speed its performance. They also integrated their Watchman file monitoring tool and found that it "made Mercurial's status command more than 5x faster than Git's status command." They then created a remotefilelog extension, which "made Mercurial clones and pulls 10x faster, bringing them down from minutes to seconds," as well as offering other performance benefits.