Project: Optimize a Hot Endpoint

Updated

September 8, 2026

Project: Optimize a Hot Endpoint

Overview

Pick or build a deliberately inefficient endpoint, then improve it with the performance workflow.

Setup

Serve GET /report that:

  1. Re-reads a JSON file every request
  2. Uses fmt.Sprintf heavily
  3. Builds strings with + in a loop

Steps

  1. Baseline load test numbers (184)
  2. Profile CPU + heap
  3. Change one thing (cache file, Builder, precompute)
  4. Remeasure
  5. Write a short report: before/after table

Acceptance

  • ≥30% p99 or allocs improvement with evidence
  • Tests still pass
  • No correctness regression
  • Profile screenshots or pprof commands recorded

Stretch

Apply PGO and note delta vs manual fixes alone.