How we made diff pages three times faster
Dec 6, 2016GitHub Engineering

Summary
This post details a significant refactor of how diff pages are rendered, moving from a monolithic approach to a progressive loading strategy. It introduces the use of `git-diff-tree --raw` to generate a 'table of contents' for diffs, followed by `git-diff-pairs` to fetch patch text for individual files. This approach significantly reduces initial load times, improves accuracy of diff statistics by using `git-diff-tree --numstat --shortstat`, and allows for more flexible handling of large diffs by setting new, higher effective limits for the entire diff while loading smaller batches initially. The post also details the use of a Scientist experiment to compare the old and new approaches.