Skip to content
Ameen Abozaid
SRC-016

Performance engineering

  • 8 Lessons
  • 4.5 h practice (estimate)
On this page 9 topics

Overview

Topics

  • Profiling
  • benchmark design
  • bottleneck elimination

Learn first

4.5 h of practice (estimate)

Learning outcomes

  1. Design benchmarks (JMH for code, load tests for systems) that measure what matters and avoid common traps.
  2. Remove bottlenecks in order of impact and stop when the target is met.
  3. Detect performance regressions in CI.
  4. Communicate performance results with uncertainty and context.

Lessons

  1. 01A performance engineering process
  2. 02Microbenchmarks with JMH
  3. 03System benchmarks that predict production
  4. 04Removing bottlenecks in order
  5. 05Regression detection in CI
  6. 06Reporting results honestly
  7. 07Demo: halving checkout p99 with evidence
  8. 08Demo: a JMH benchmark that lied, and the fixed version

Lab and exercises

Lab

SRC-016-LAB1 · Meet the latency target

Outcomes: 1–4 · Time: ~4.5 h Bring checkout p99 within the SLO at 10× forecast load. Baseline with a constant-rate load test, profile, remove bottlenecks in order, and stop at the target. Add a performance regression check to CI, then seed a regression. Acceptance: before/after evidence; CI catches a seeded regression.

Exercises (assessment: performance report review)

IDOutcomeTask
SRC-016-EX011Review a JMH benchmark with an unused result and constant input; list the traps and rewrite it.
SRC-016-EX021Design a load test plan for checkout at 1×, 5×, and 10× forecast: workload mix, arrival model, duration, pass criteria.
SRC-016-EX032Given a table of step shares of p99 (45, 25, 15, 10, 5), choose the order of work and the likely maximum gain from the first fix.
SRC-016-EX043Design the CI regression check: benchmark set, baseline, tolerance, failure behavior.
SRC-016-EX054Rewrite "p99 improved from 800 ms to 400 ms" as an honest report line with context and uncertainty.
SRC-016-EX062Case: the team wants to rewrite the JSON library to save 3% of checkout time. Give your recommendation.
Show solutions
  • EX01 Traps: dead-code elimination and constant folding. Consume via Blackhole or return, use @State inputs with variety, add forks, warm-up and measurement.
  • EX02 Mix by real traffic proportions, constant arrival rate, steps, long enough for steady state, pass if p99 and error rate meet the SLO at 10×.
  • EX03 Order by share; the first fix at 45% could remove up to 45% at best; re-measure after each since shares change.
  • EX04 Small stable JMH subset plus a smoke load test on dedicated hardware; compare with main baseline; tolerance from measured noise; fail with a report.
  • EX05 For example: "Checkout p99 fell from 800 ms (95% CI 780 to 820) to 400 ms (385 to 415) over five 20-minute runs at 10× forecast, on the staging environment with stubbed payment latency; production may differ in cache hit rates."
  • EX06 Decline: even removing it entirely gains at most 3%; spend effort on the largest remaining bottleneck.
  • Outcome 3 is also covered by the lab CI check and Q07-Q08; outcome 4 by Q10.

Workplace evidence: a measured performance improvement you delivered.

Quiz

Outcomes: O1 benchmark design · O2 bottleneck removal · O3 CI regression detection · O4 reporting.

A self-check for you: nothing is graded, saved or sent anywhere. Choose an answer, then check it. You can try again as often as you like.

  1. 1JMH is used to:O1
  2. 2A benchmark whose result is unused may be:O1
  3. 3Why prefer a constant arrival rate in load tests?O1
  4. 4A system benchmark needs:O1
  5. 5The first fix should target:O2
  6. 6If a step is 5% of time, eliminating it gains at most:O2
  7. 7Regression checks in CI should compare against:O3
  8. 8Benchmarks in CI should run on:O3
  9. 9When do you stop optimizing?O2
  10. 10An honest performance report includes:O4

Practical part

Performance report review (SRC-016 assessment): critique a given report and present SRC-016-LAB1 evidence. Pass: at least 8/10 on the quiz, before/after results with variance, and a CI check that fails on a seeded regression.

Common mistakes

JMH-free microbenchmarks; optimizing non-bottlenecks; single-run results.

Assessment

Performance report review.

Workplace evidence

A measured performance improvement you delivered.

Career relevance

Cost-performance optimization (SRA-007).

Type to search levels, phases, modules and lessons.