TLDR Dev · MISCELLANEOUS

THE UPHILL CLIMB OF MAKING DIFF LINES PERFORMANT

github.blog11 min read

Summary from the TLDR Dev newsletter

GitHub's “Files changed” tab struggled with large pull requests because each diff line contained 8+ React components, leading a 10k-line diff to consume 1GB of heap and create over 400k DOM nodes. The team solved this by rewriting the feature to use only two components per line, flattening state, and adding virtualization, resulting in a 78% cut in INP and a 50% reduction in memory.