news.volyx.in

“Clean” code, horrible performance (computerenhance.com)

739 points by eapriv · 1281 days ago · 907 comments on HN

Article summary

The article discusses the trade-off between writing 'clean' code and achieving good performance, with the author arguing that excessive use of abstractions and indirections can lead to slower software. The discussion focuses on the importance of considering performance when writing code, rather than solely prioritizing cleanliness and maintainability. The article's content is not available, but the comments suggest that it presents examples of how simplifying code can lead to significant performance improvements. The comments also touch on the role of indexing in databases and the impact of I/O operations on performance.

Main themes

  • clean code vs performance
  • database indexing
  • premature optimization
  • code simplicity
  • performance optimization
  • compiler optimization

What commenters say

  • Writing clean code can sometimes come at the expense of performance, and prioritizing performance can lead to simpler and more efficient code.
  • Premature optimization is often misused as an excuse for being careless with code performance, and considering performance from the start can be beneficial.
  • The use of indexes in databases can greatly improve performance, and simple indexing techniques can often yield significant gains.
  • Overly complex code can be difficult to optimize, and simplifying code can make it easier to identify and address performance bottlenecks.
  • The importance of performance varies depending on the specific use case and requirements of the software, and a balanced approach that considers both cleanliness and performance is often necessary.
  • Some commenters argue that the pursuit of performance can lead to overly complex and hard-to-maintain code, while others argue that simplicity and performance are not mutually exclusive.
  • The role of compilers and hardware in optimizing code is also discussed, with some commenters arguing that compilers can often optimize code effectively, while others argue that manual optimization is still necessary in many cases.