News for hackers. Stuff that matters.
Re:Performance Matters by defined on Tuesday August 20, 2019 @04:17AM (#20744790)
That’s oversimplifying it. Knuth was writing about micro-optimizations, like writing a section of code in assembly language to shave off some milliseconds from a critical section of code.

What many people today mean by optimization is a far cry from that.

Here’s a real-life example. Some code was super-slow and nobody could figure out why. It took only a minute to see the code was passing a string (in C++) by value, causing unnecessary copy construction and destruction (in a tight loop, to boot).

Writing that code by passing a const reference in the first place is Good Coding 101, but many people might consider that “premature optimization”.

There are no comments on this comment yet.