⚡AgentSkills
🧰 Engineering Essentials · Code Quality

Profile before optimizing (Scala)

Measure hot paths with real data shapes, optimize measured bottlenecks, verify wins.

intermediate~35 minAll Software Engineers

Steps

  1. 1Define target metric: p95 latency? memory ceiling? throughput?
  2. 2Build benchmark using PRODUCTION-shaped data volumes
  3. 3Profile CPU + memory + allocations; identify top three offenders
  4. 4Optimize one offender at a time; re-measure after each change
  5. 5Check second-order effects: cache misses, GC pressure, lock contention
  6. 6Record before/after numbers in the PR for future archaeologists
  7. 7Profile with async-profiler; watch GC pressure from allocations
  8. 8Enforce scalafmt/scalafix gates; mind closure capture costs

Common Pitfalls

  • ▲Optimizing intuition while profile shows I/O waits
  • ▲Micro-benchmarks on toy data lying about production

Commands

Install with skills CLI
$ npx skills add aniruddhaadak80/skills --skill code-quality-performance-profiling-scala
Install globally
$ npx skills add aniruddhaadak80/skills --skill code-quality-performance-profiling-scala -g

Tags

#performance#profiling#engineering-essentials#code-quality

Related skills

Review order, comment quality, and scope discipline making PRs fast and kind.

🧰 Engineering Essentials·~25m

Review order, comment quality, and scope discipline making PRs fast and kind.

🧰 Engineering Essentials·~25m

Review order, comment quality, and scope discipline making PRs fast and kind.

🧰 Engineering Essentials·~25m