Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

GitHub Engineering 6 min read Case study mediumAdept

How GitHub Actions renders large-scale logs

GitHub Actions replaced a third-party virtualization library with a custom one to render job logs of up to 50k lines smoothly, including on mobile. Usage data showed 99.51% of jobs have fewer than 50k lines, so the team dropped data virtualization and kept only UI virtualization, truncating oversized logs behind a download link. The custom library estimates line heights instead of measuring them and uses relative rather than absolute positioning, so imprecise estimates don't clip lines. It keeps a single scrollable area with non-virtualized sticky step headers and adds or removes DOM nodes in clusters of 50 lines to limit mutations during fast scrolling.

Assumes: DOM rendering basicslist virtualization

Related posts

  • Rendering huge pull requests in the GitHub Copilot app

    GitHub Engineering mediumAdept

    The GitHub Copilot app's pull request view stays responsive on a 2,200-file, million-line diff with 400+ review comments by splitting document height into two geometries: exact, precomputed prefix-summed code rows and lazily measured dynamic blocks for comments, drafts and composers. A single idle- and scroll-gated measurement pass scoped to about 2400px around the viewport replaces per-block ResizeObserver write-back, which caused feedback loops. Observers only flag blocks for re-measurement, except for user-caused resizes, which commit synchronously at most once per frame. Identity-based scroll anchoring keeps corrections small, and a cache of recent diffs prevents an instantly drawn shell from sitting around an empty diff. Bugs were found with permanent in-app probes asserted as CI budgets and an autonomous headless change→measure→improve loop.

  • Crafting a better, faster code view

    GitHub Engineering mediumAdept

    GitHub's new React-based code view renders an 18,000-line file in under a second instead of nearly 27 seconds. Lines outside the viewport are virtualized away, while an invisible textarea holds the full raw text so native Ctrl+F, keyboard navigation and screen readers keep working. A custom find-in-file was dropped after beta users and assistive-technology needs favoured the browser's native find. The visible syntax-highlighted overlay is hidden from find by injecting each character through CSS :before pseudoelements. Switching the highlighter to emit offset/class ranges and building HTML strings outside React cut a jump-to-end scroll from about 4.5s to about 0.8s of main-thread work.

  • The uphill climb of making diff lines performant

    GitHub Engineering mediumAdept

    GitHub rebuilt the React diff-line components in the pull request Files changed tab after large PRs pushed the JavaScript heap past 1 GB, DOM counts above 400,000 and INP to unusable levels. The v2 design cut per-line React components from eight to two, replaced per-line event handlers with a single top-level handler keyed on data attributes, and moved commenting and menu state into conditionally rendered children. It also confined useEffect to the file level and switched to O(1) Map-based lookups. On a 10,000-line split diff this cut rendered components by 74%, memory by about 50% and INP from ~450 ms to ~100 ms. For p95+ PRs, TanStack Virtual windowing gave a 10x heap and DOM reduction and 40–80 ms INP, supplemented by cheaper CSS selectors, GPU transforms, partial hydration and progressive diff loading.

  • From latency to instant: Modernizing GitHub Issues navigation performance

    GitHub Engineering mediumAdept

    GitHub made Issues navigation feel instant by moving to a local-first, stale-while-revalidate model: render issue pages from client-side data first, then revalidate in the background. A persistent IndexedDB cache made about 22% of React soft navigations instant at a ~33% hit rate, with roughly 4.7% server/cache divergence. Rate-limited, low-priority preheating from issue lists and an in-memory cache tier raised the hit ratio to ~96%, so up to ~70% of React navigations became instant. A service worker extends the cache to Turbo and hard navigations by signalling cache hits via a request header, letting the server return a thin HTML shell instead of a full server-rendered page. The tradeoff on hard navigations is that the critical path shifts to JavaScript download and execution.

  • Updating Illustrations at Scale

    Shopify Engineering mediumAdept

    Shopify's Polaris team built @shopify/get-repo-images, an open-source crawler that finds image files and every line of code referencing them across GitHub repositories, then serves a browsable, sortable website so illustrators could update illustrations fragmented across thousands of repos during a design-language refresh. GitHub code search was ruled out due to API limits, stripped wildcard characters and fragment caps. A first Node.js prototype (git clone, globby, json-server, Preact) took over 35 minutes for 24 repos. Rewriting the cloning and searching as a single parallel Go binary distributed via npx, with a Next.js frontend, cut that to 8 minutes, with cloning as the remaining bottleneck.

The quest for software engineering knowledge.

Look:
Layout: