Why do we both with silly optimizations first? view full post
I regret to inform you that member initialization lists will not make your program noticeably faster.
The point of this post is to vent, so it is highly opinionated.
- Style-based performance optimizations are a waste of time
- Good fundamentals are more important than micro-optimizations
- Compile and test times are vastly underrated
- For some reason, code / function generalization is valued higher than ergonomics or real performance.
I form this opinion based on experiences with:
- The near-constant debate over style, move semantics, constructor initialization lists, and other micro-optimizations
- Making small changes and seeing large performance gains, sometimes 1,000-100,000x by:
- Using hardware more efficiently
- Reframing the core problem
- Using the right data structures
- Using the right algorithms
In short, if you’re worried about the performance problems with initialize+copy vs std::move, you’re either doing something very wrong or you’re down to the last 0.1% of performance improvements.
Comments
I have not configured comments for this site yet as there doesn't seem to be any good, free solutions. Please feel free to email, or reach out on social media if you have any thoughts or questions. I'd love to hear from you!