Safeguard
Developer Tools•

Does SBOM generation slow your CI pipeline, and how do you measure it?

SBOM generation costs seconds on a lockfile and more on a large image. Measure it per job, set a budget, and decide what runs on every commit.

Safeguard Security Team
4 min read

It can, but the cost depends on what you scan. Reading a lockfile is quick, while unpacking a large container image takes longer. Measure each job on your own pipeline, set a time budget, and run the heavier scans on merge or release rather than on every commit.

Where the time goes

Generation time is not one number. Several things add up.

FactorEffect
Input typeLockfile reading is light, image unpacking and file walks are heavier
Image size and layer countMore layers and files means more to index
Cold or warm cacheTools that download metadata or databases on each run are slower
Network lookupsLatency and rate limits add delay and variance
Runner sizeSmall shared runners are slower and less predictable
Scan scopeFinal stage only, or every build stage

Docker's SBOM documentation shows an example of scope driving cost: by default the scan covers the final stage, and scanning additional stages or the build context needs extra arguments. More scope means more work.

How to measure

  1. Pick three representative jobs: a small service, a large monorepo, and a big container image.
  2. Run each build with and without SBOM generation, at least five times each, and record wall clock time.
  3. Take the median and the slowest run, not the average. The slowest run is what developers complain about.
  4. Run once with a cold cache and once with a warm one.
  5. Record the SBOM size in kilobytes or megabytes, since upload and storage add time.
  6. Repeat after any tool upgrade.

Report the difference as seconds and as a percentage of total pipeline time. A job that adds twelve seconds to a ten minute build is a different conversation from one that adds three minutes to a two minute build.

Ways to keep it cheap

  • Generate from the lockfile in pull requests, and from the built image on merge. The first answers "what did this change add?" fast, and the second answers "what shipped?".
  • Run in parallel. SBOM generation rarely depends on tests, so put it beside them.
  • Cache metadata and databases between runs where your tool allows it.
  • Avoid network lookups in the hot path, or mirror what you need.
  • Skip unchanged inputs. If the lockfile and base image digest are identical to the last run, reuse the earlier result.

Decide what blocks a build

Time budgets and gate rules go together. A scan that takes a minute is fine if it is a gate on pull requests. A scan that takes ten should not block every push. Write the rule down: what must pass before a merge, what runs after, and what runs nightly. Developers tolerate a gate they understand and resent a slow one they cannot explain.

Try it yourself

Click through it at your own pace, or open it full screen. See where in a pull request flow a dependency check sits and what happens when it fails.

Where Safeguard fits

Safeguard offers policies and gates that can check dependencies in a pull request, plus dependency scanning and SBOM output. Test the timing on your own repository with the free scan at gold.safeguard.sh/scan and compare it with your budget.

Quick check

Should every commit generate an SBOM?

Not necessarily. Lockfile based checks on pull requests are cheap, and full image SBOMs can wait for merge or release.

Which timing number should I report?

The median and the slowest run. The slowest run is what developers feel.

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.