The Need for Speed: Cut Your Spring Boot Build Times by 70%

45-60 minutes

Talk Overview

Stop accepting slow tests as “just the way it is.”

Your Spring Boot test suite doesn’t have to take 20+ minutes. This session shows you how to achieve 70% speed improvements without rewriting tests or adopting new frameworks - just smarter use of Spring’s built-in capabilities.

Through live benchmarking and real-world examples, you’ll see exactly where those performance gains come from and learn how to apply them to your own projects.

The Speed Problem

The Reality:

  • Developers waiting 20+ minutes for test feedback
  • CI/CD pipelines that bottleneck deployments
  • Context restarts happening dozens of times per test run
  • Teams avoiding running tests locally because they’re too slow

The Impact:

  • Delayed feedback loops
  • Reduced productivity
  • Slower release cycles
  • Developer frustration

The Hidden Performance Feature

Spring’s TestContext caching is incredibly powerful, but most developers don’t understand how it works or how to leverage it effectively.

You’ll Learn:

  • How Spring decides when to reuse vs rebuild contexts
  • What the context cache key actually includes
  • Why tiny configuration differences kill performance
  • How to design tests for maximum reuse

The Silent Performance Killers

1. @MockBean Overuse

The Problem: Every unique @MockBean combination creates a new context.

What You’ll Learn:

  • Why @MockBean is a context cache killer
  • Alternative approaches that maintain speed
  • When @MockBean is actually worth the cost

2. Configuration Variations

The Problem: Small property differences multiplying contexts.

What You’ll Learn:

  • How to identify configuration conflicts
  • Patterns for consistent test configuration
  • Strategies to reduce configuration variations

3. Test Execution Order

The Problem: Context thrashing from poor test ordering.

What You’ll Learn:

  • How test order affects context reuse
  • Tools to visualize context loading patterns
  • Optimization strategies for test execution

4. @DirtiesContext Abuse

The Problem: Nuclear option that forces full context reloads.

What You’ll Learn:

  • Why @DirtiesContext is almost never the right solution
  • Root causes that lead to its usage
  • Better alternatives for test isolation

The Optimization Journey

Through live demonstrations, you’ll see:

  1. Baseline: A real application with 20-minute test runs
  2. Analysis: Using profiling tools to identify bottlenecks
  3. Optimization: Applying strategies step by step
  4. Results: Achieving 6-minute test runs (70% improvement)

Each optimization comes with:

  • Before/after benchmarks
  • Code examples
  • Trade-off analysis
  • Implementation guidance

Proven Strategies

Fast Feedback Patterns

  • Group tests by context configuration
  • Minimize @MockBean usage
  • Standardize test configurations
  • Leverage test slices effectively

Measurement & Monitoring

  • Profile context loading times
  • Track context cache statistics
  • Identify rogue tests
  • Monitor improvements over time

Practical Implementation

  • Incremental optimization approach
  • Low-risk changes that deliver big wins
  • Team adoption strategies
  • Maintaining improvements long-term

Session Format

This is a hands-on, benchmark-driven session featuring:

  • Live profiling of real Spring Boot applications
  • Before/after performance comparisons
  • Interactive optimization sessions
  • Audience participation in identifying bottlenecks

You’ll see actual build times drop in real-time as we apply each strategy.

Real Results

Teams who’ve applied these strategies have achieved:

  • 78% reduction in test execution time (22 min → 5 min)
  • 85% fewer context reloads
  • 3x faster developer feedback loops
  • 50% shorter CI/CD pipeline times

These aren’t theoretical - they’re results from production applications.

Who Should Attend

Perfect for:

  • Teams with test suites taking 15+ minutes
  • Developers tired of slow feedback loops
  • Engineering leaders seeking productivity improvements
  • Anyone who’s ever added @DirtiesContext without understanding why

What You’ll Leave With

  • Understanding of Spring’s TestContext caching internals
  • Concrete strategies to optimize your test suite
  • Tools and techniques for profiling test performance
  • An action plan to achieve 70% speed improvements
  • Code patterns you can implement immediately

Beyond the Basics

This isn’t about “run tests in parallel” or “use a faster CI server.” This is about fundamentally understanding how Spring Boot manages test contexts and leveraging that knowledge for dramatic performance gains.

Stop accepting slow tests. Start shipping faster.

Talk Abstract

Your Spring Boot test suite is a time thief. Every context reload, every unnecessary restart, every @DirtiesContext annotation is stealing precious minutes from your development flow. But what if those 20-minute test runs could shrink to just 6 minutes?

This session reveals the game-changing power of Spring's TestContext caching - a feature hiding in plain sight. We'll dissect how Spring decides to reuse or rebuild application contexts, expose the silent performance killers in your test suite, and demonstrate proven strategies that deliver dramatic speed improvements.

Through hands-on examples, you'll discover why @MockBean might be your worst enemy, how test execution order affects performance, and which configuration patterns maximize context reuse. We'll benchmark real applications, showing exactly where those 70% gains come from.

What You'll Learn

  • Understand Spring's TestContext caching mechanism
  • Identify what triggers context reloads in your tests
  • Master configuration patterns that maximize context reuse
  • Learn why @MockBean kills performance and what to do instead
  • Optimize test execution order for maximum speed
  • Use profiling tools to find performance bottlenecks
  • Implement changes that deliver 70% faster test runs

Prerequisites

  • Experience with Spring Boot testing
  • Familiarity with @SpringBootTest and test slices
  • A slow test suite you want to optimize

Book This Talk

Request Speaking Engagement
We'll discuss your event requirements and customize the presentation for your audience.

Topics Covered:

Spring TestContext Caching Context Reuse Optimization Test Execution Order Configuration Patterns for Speed Performance Benchmarking @MockBean Performance Impact Build Time Optimization

Target Audience:

  • Teams with slow Spring Boot test suites
  • Developers frustrated with long CI/CD pipelines
  • Engineering leaders seeking productivity improvements
  • DevOps engineers optimizing build pipelines

Available For:

conferences meetups corporate events tech talks
Have questions?
Contact us

Ready to bring this talk to your event?

Request Speaking Engagement

Related Talks

5 Spring Boot Testing Mistakes Developers Trap Into

Your Spring Boot tests are passing, but can you really trust them? This session reveals five …

45-60 minutes
Learn more →

Stop Fighting Your Spring Boot Tests

Waited 20+ minutes for tests to run? Skipped running tests locally to 'save time'? Seen tests pass …

45-60 minutes
Learn more →

Testing Spring Boot Applications Demystified

Testing Spring Boot applications doesn't have to be overwhelming. This talk demystifies Spring …

60-90 minutes
Learn more →