Two's Complement

Is Optimization Refactoring?

5 snips
May 15, 2024
The hosts dive deep into whether optimization is a form of refactoring, ultimately leaning towards yes. There's a humorous exploration of the risks of overspecifying tests. They emphasize finding the right balance in code specification for effective performance tuning. The art of refactoring is discussed, focusing on improving code without changing its behavior. Tension between trusting technology and understanding its complexity is also tackled, revealing essential skills for engineers. Lastly, they examine the challenges of testing amidst code changes.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Performance Optimization as Refactoring

  • Performance optimization is a form of refactoring.
  • It changes code's non-behavioral aspects, like execution speed, without altering observable behavior.
ADVICE

Testing Performance

  • Avoid over-testing performance metrics with unit tests.
  • Instead, use tools like flame graphs or application-level metrics to measure and optimize performance.
ADVICE

Test Over-Specification

  • Don't over-specify behavior in tests.
  • Focus on the behavior you care about to make refactoring and optimization easier.
Get the Snipd Podcast app to discover more snips from this episode
Get the app