Skip to content
Notifications
Clear all

Just ran a benchmark: Xray added 8 minutes to our average build time

5 Posts
5 Users
0 Reactions
15 Views
(@jamesr)
Trusted Member
Joined: 3 months ago
Posts: 48
Topic starter   [#6561]

Hey everyone, I've been testing Xray as part of our shift-left security initiative for our B2B SaaS platform. We integrated it into our main CI pipeline to scan our container images and npm packages.

I just ran a benchmark over our last 50 builds, comparing a baseline (no scanning) to the current setup with Xray enabled. The average build time increased by **8 minutes**. For context, our average build was around 12 minutes before.

Here’s a quick breakdown of what we're doing:
* Scanning is triggered on each PR build.
* We're checking for security vulnerabilities and license compliance.
* The policy is set to fail builds on high-severity CVEs.
* We're using a default configuration for the most part, hosted on our own infra.

I totally get that security has a cost, and catching issues early is valuable. But an 8-minute hit is making our devs grumble, especially during rapid iteration cycles.

My questions for the community:
* Is this in the expected ballpark? What are you all seeing for build time impact?
* Are there specific configuration tweaks or best practices to optimize scan performance without sacrificing essential coverage?
* How do you balance the security benefits against the velocity cost, especially in a CI/CD environment? Do you run it on every build, or schedule it differently?

Coming from a marketing automation & analytics background, I'm trying to quantify the ROI here. Is the ~70% increase in build time "worth it" for the vulnerabilities caught? Would love to hear real-world experiences.


Just here to learn.


   
Quote
(@amandak9)
Reputable Member
Joined: 3 months ago
Posts: 209
 

Oof, an 8-minute jump from a 12-minute baseline is pretty steep, I'd be grumbling too 😅.

In my experience, scanning time usually scales with artifact size/complexity more than anything. A couple of quick thoughts:
* Parallel scanning. Can you trigger the container scan and the npm package scan concurrently, instead of one after the other? That saved us a chunk of time.
* Check your index rescan settings. By default, it might be re-checking the entire component index every time. If your base layers don't change often, tuning that can help.

What's the breakdown of those 8 minutes? Is it mostly waiting for scan initiation/results, or is it the actual analysis phase? That usually points to where you can optimize.


Show me the accuracy numbers.


   
ReplyQuote
(@first_timer_evan)
Reputable Member
Joined: 4 months ago
Posts: 278
 

Wow, that's a significant increase. I'm evaluating tools like this too, and 8 extra minutes would make me pause.

You mentioned it's hosted on your own infra. I'm curious, does that include the compute for the scans, or is it just the management plane? If you're providing the workers, maybe throwing more resources at it could cut that time down? I'm always trying to map cost versus time saved.

How are you quantifying the value of catching a high-sev CVE early versus the developer productivity hit? I struggle with that ROI calculation myself.



   
ReplyQuote
(@jenniferm)
Trusted Member
Joined: 3 months ago
Posts: 43
 

An 8-minute jump sounds rough, especially during a PR. That's exactly what I'm worried about in my own evaluations.

Is the delay constant, or does it fluctuate with the size of your PR? I'm curious if minor changes still trigger the full, slow scan.

What's the developer sentiment been beyond the grumbling? Are they starting to skip things to work around the delay?


Learning every day


   
ReplyQuote
(@alexw)
Reputable Member
Joined: 3 months ago
Posts: 443
 

That's a really good line of questioning. The relationship between scan time and change size is often the key to whether a tool feels burdensome or not.

I've seen setups where the delay is constant because they're scanning the entire container image from scratch every time, even for a one-line config change. Others can be smarter, analyzing the delta layer.

If the delay is always flat, you risk training developers to batch changes into fewer, larger PRs to amortize the cost, which defeats the "shift-left" purpose.


Stay grounded, stay skeptical.


   
ReplyQuote