Security

GitHub Incremental CodeQL: Slashing PR Scan Times by 80%

Dillip Chowdary

Dillip Chowdary

March 24, 2026 • 12 min read

Security scanning has long been the "speed bump" of the CI/CD pipeline. GitHub's latest breakthrough in differential analysis is about to change that forever.

For years, the promise of DevSecOps has been hindered by a simple technical reality: semantic code analysis is computationally expensive. Traditional CodeQL scans required a full database rebuild for every commit, leading to scan times that could stretch into tens of minutes for large monorepos. As of March 24, 2026, GitHub has officially moved Incremental CodeQL into general availability, promising a staggering 80% reduction in scan times for Pull Requests.

The Problem with Monolithic Scans

In a standard static analysis workflow, the engine must parse the entire codebase to understand the data flow and control flow. While this ensures high precision, it is highly redundant. If a developer changes 50 lines of code in a 1-million-line repository, re-analyzing the 999,950 unchanged lines is a massive waste of compute resources.

This "Monolithic Scan" approach often led to developers bypassing security checks or waiting in long queues, directly impacting the DORA metrics of high-performing engineering teams. The friction was not just annoying; it was a systemic risk.

How Incremental Analysis Works

The core of the new engine is Differential Semantic Analysis. Instead of throwing away the results of previous scans, Incremental CodeQL maintains a persistent "Partial Semantic Graph" of the codebase. When a PR is submitted, the engine performs the following steps:

By focusing only on the "delta," GitHub has achieved sub-minute scan times for complex security queries that previously took 15 minutes or more.

Benchmarks and Real-World Impact

In early testing with enterprise partners, the results have been transformative. For a major financial services firm with a 4GB CodeQL database, the average PR scan time dropped from 22 minutes to just 4.2 minutes. This 81% improvement allowed the team to enforce "Blocking Scans" on all PRs without slowing down their release cycle.

Furthermore, the reduction in compute time translates directly to Sustainability goals. GitHub estimates that the widespread adoption of incremental scans could reduce the carbon footprint of CI/CD infrastructure by millions of metric tons annually.

Master Your Security Workflow

Don't let scan times slow your team down. Use **ByteNotes** to document your security patterns and keep your "Incremental" knowledge organized.

Conclusion: The New Baseline for Secure Delivery

The launch of Incremental CodeQL marks a turning point in the history of application security. We are moving from a world where security is an "event" that happens at the end of the cycle to a world where security is a "stream" that flows alongside development. For the modern engineer, this means less waiting and more building—with the confidence that the code is secure by design.