Project: Optimize a Hot Endpoint
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:
- Re-reads a JSON file every request
- Uses
fmt.Sprintfheavily
- Builds strings with
+in a loop
Steps
- Baseline load test numbers (184)
- Profile CPU + heap
- Change one thing (cache file, Builder, precompute)
- Remeasure
- 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.