Safeguard
Developer Tools•

How long should reachability analysis take, and what drives it?

Run time grows with program size and with how precise the call graph is. Learn what drives it and how to fit analysis into pull requests and nightly runs.

Safeguard Security Team
3 min read

There is no single right number. Run time depends on code size, dependency depth and call graph precision. More precise graphs take longer and use more memory, so teams usually run a fast analysis on pull requests and a deeper one nightly or at release. Measure on your own repository rather than trusting a headline figure.

What drives the time

The Wikipedia call graph entry notes that a more precise call graph approximates the real program better, at the cost of taking longer to compute and more memory to store. It also notes that the most precise form, a fully context-sensitive graph, is usually not computed statically for large programs because it would take too long.

Practical drivers:

  • Lines of code and number of dependencies. More nodes and edges.
  • Language features. Dynamic dispatch and function values need alias reasoning, which is costly.
  • Precision settings. Deeper context tracking multiplies work.
  • Caching. Reusing graphs of unchanged dependencies saves most of the time.
  • Scope. Analysing only changed modules is faster than the whole monorepo.

Matching depth to the moment

MomentGoalSuitable approach
Pull requestFast feedback to the authorIncremental, lower precision, cached dependency graphs
NightlyFresh backlog orderingFull run on main branch
ReleaseEvidence for what shipsDeepest run on the built artifact
New advisoryQuick answer for one CVETargeted query against an existing graph

How to benchmark a tool fairly

  1. Pick three repositories: small, medium and your largest.
  2. Time a cold run and a warm run with caching.
  3. Record peak memory, since a run that exhausts a CI runner fails in practice.
  4. Time a run after a one-line change to see incremental behaviour.
  5. Note any timeouts and what the tool reports when it times out. It should say so, not return a partial result labelled complete.

Budgeting for CI

Choose a time budget for pull request checks that developers will tolerate, often a few minutes, and confirm that the analysis fits. If it does not, move the deep analysis out of the blocking path and keep a fast check in it. A check that is too slow gets disabled, which is worse than a lighter check that stays on.

A reporting detail that matters

A timed-out analysis must not turn into a clean result. Ask how the tool labels incomplete runs. Unknown is the correct label.

Safeguard includes reachability analysis alongside SBOM and dependency scanning, and you can run a free scan at gold.safeguard.sh/scan to see the output on your own repository.

Quick check

Should reachability block pull requests?

Only if it is fast and its results are trusted. Many teams make it advisory on pull requests and enforce at release.

What if the run times out?

The result should be marked incomplete or unknown, never clean.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.