AI Instructor Live Labs Included

Java Performance and Production Patterns

Optimize a Java order processing system through concurrency, async pipelines, connection pooling, caching, JMH benchmarking, and GC tuning. Gain 40x throughput improvement across 7 hands-on labs.

Advanced
18h 20m
14 Lessons
SMU-JAVA-PERF
Java Performance and Optimization Badge

View badge details

About This Course

Master the art of building high-throughput, production-ready Java applications. In this advanced course, you play the role of a senior Java engineer at FreightFlow a logistics company processing hundreds of thousands of shipment orders daily. You will profile and progressively optimize the Order Processing System through six performance transformations: concurrent thread pool execution, CompletableFuture async pipelines, HikariCP connection pooling with batch inserts, Caffeine in-memory caching, JMH microbenchmarking, and GC tuning with G1GC and ZGC. Each exercise lesson produces measurable throughput improvements, turning an 80 orders/sec sequential processor into a 3,500+ orders/sec production-grade system.

Course Curriculum

14 Lessons
01
AI Lesson
AI Lesson

JVM Internals & Garbage Collection

1h 0m

Learn the JVM memory model including heap regions (Eden, Survivor, Old Gen, Metaspace), object allocation lifecycle, minor vs major GC, GC pause vs throughput tradeoffs, G1GC vs ZGC vs Parallel GC, reading GC logs, and OutOfMemoryError diagnosis. This lesson sets the foundation for understanding why the FreightFlow Order Processor needs optimization.

02
Lab Exercise
Lab Exercise

Concurrency - Lab Exercises

2h 25m 5 Exercises

Replace the sequential order processing loop in the FreightFlow OrderProcessor with a ThreadPoolExecutor-based implementation that processes orders in parallel and collects Future results. Compare throughput before and after using the built-in BenchmarkRunner.

03
AI Lesson
AI Lesson

Concurrency — Threads, ExecutorService

1h 0m

Learn Thread vs Runnable vs Callable, ExecutorService lifecycle, ThreadPoolExecutor constructor parameters, Future.get() blocking, thread safety with synchronized and AtomicLong, and deadlock diagnosis. Deep dive into concurrent programming patterns for high-throughput Java applications.

04
Lab Exercise
Lab Exercise

Async - Lab Exercises

2h 5m 4 Exercises

Replace Future.get() blocking calls with CompletableFuture pipelines — supplyAsync, thenApply, exceptionally, and CompletableFuture.allOf — in the FreightFlow Order Processor. Compare throughput with the Future-based implementation.

05
AI Lesson
AI Lesson

CompletableFuture & Async Programming

1h 0m

Master CompletableFuture API including supplyAsync, thenApply, thenCompose, thenCombine, allOf, anyOf, exception handling with handle vs exceptionally, custom executors for async stages, and virtual threads in JDK 21 Project Loom.

06
Lab Exercise
Lab Exercise

DB Performance - Lab Exercises

2h 5m 4 Exercises

Replace DriverManager.getConnection() with HikariCP DataSource, configure pool size and timeouts, and convert single-row INSERTs to batch inserts using addBatch()/executeBatch() in the FreightFlow Order Processor.

07
AI Lesson
AI Lesson

Connection Pooling & Database Performance

1h 0m

Learn why DriverManager.getConnection() is catastrophically slow in production, HikariCP as the fastest Java connection pool, pool sizing with Little's Law, prepared statement caching, N+1 query problem, batch inserts vs individual inserts, and slow query analysis.

08
Lab Exercise
Lab Exercise

Caching - Lab Exercises

1h 15m 6 Exercises

Hands-on exercises implementing caching with Caffeine, measuring cache hit rates, and comparing latency with and without caching in the FreightFlow order processing system.

09
AI Lesson
AI Lesson

Caching Strategies

45m

AI-guided lesson on cache-aside vs write-through patterns, Caffeine eviction policies, Spring cache annotations (@Cacheable, @CacheEvict, @CachePut), cache stampede problem, and when not to cache in production Java applications.

10
Lab Exercise
Lab Exercise

Profiling - Lab Exercises

1h 15m 6 Exercises

Hands-on exercises writing JMH microbenchmarks to measure the performance of the Caffeine-cached getPrice() method vs uncached, configuring JMH parameters, and running benchmarks with GC profiling.

11
AI Lesson
AI Lesson

Profiling & Benchmarking with JMH

45m

AI-guided lesson on why System.nanoTime() benchmarks lie, JMH architecture and annotations (@Benchmark, @State, @Setup, @BenchmarkMode), throughput vs average time modes, GC profiler, async-profiler, and JVM flags for accurate profiling.

12
Lab Exercise
Lab Exercise

GC & Profiling - Lab Exercises

1h 15m 5 Exercises

Hands-on exercises tuning JVM GC flags (G1GC, ZGC), analyzing GC logs, comparing throughput across GC algorithms, and running JMH benchmarks with GC profiler to validate the tuning impact on the FreightFlow processor.

13
AI Lesson
AI Lesson

Capstone Briefing

30m

AI-guided capstone briefing reviewing all FreightFlow optimizations (JVM GC, ThreadPoolExecutor, CompletableFuture, HikariCP, Caffeine, JMH) and introducing the capstone project: add async notification via CompletableFuture.runAsync() with circuit breaker and produce a final benchmark comparison report.

14
Lab Exercise
Lab Exercise

Capstone: FreightFlow Async Notification & Final Benchmark

2h 0m 7 Exercises

Capstone project: replace the remaining synchronous email notification bottleneck with CompletableFuture.runAsync() in a dedicated thread pool, add a circuit breaker pattern, and produce a final JMH benchmark comparison report documenting the complete ~18x performance improvement.

This course includes:

  • 24/7 AI Instructor Support
  • Live Lab Environments
  • 7 Hands-on Lessons
  • Completion Badge
Java Performance and Optimization Badge

Earn Your Badge

Complete all lessons to unlock the Java Performance and Optimization achievement badge.

Skill Level Advanced
Total Duration 18h 20m
Java Performance and Optimization Badge
Achievement Badge

Java Performance and Optimization

Awarded for completing the Java Performance course, demonstrating mastery of JVM tuning, profiling, concurrent programming, and performance optimization techniques.

Course Java Performance and Production Patterns
Criteria Complete all lessons and pass assessments in the Java Performance and Optimization course.
Valid For 730 days

Skills You'll Earn

JVM Tuning Performance Profiling Concurrency Memory Management Benchmarking Optimization Patterns

Complete all lessons in this course to earn this badge