News for hackers. Stuff that matters.
Re:Zebras Hate You for No Reason: Why Amdahl's Law Is Mislea... by bstpierre on Saturday December 03, 2022 @05:29PM (#33848124)
At least twice during my career I’ve had to shrink some binary output so it can fit onto a fixed size part in some embedded system.

Once it was a FTTX CPE, and it needed to ship but the binary was a couple KB too big. The programmer on the project found a little bit of savings but not enough. I looked at the code, looked at the assembly output, and found a spot where a switch/case was being transformed into a huge jump table that was mostly sparse. (The embedded toolchain compiler wasn’t great at optimization.) A little refactor to this one function was enough savings to be just under the limit for whatever chip they were using. (I feel bad for the next person who has to fix a bug in that product.)

The relevant aspect to my story is that sometimes an improvement in one area can make another area worse! But that’s ok, because even though my function rewrite was almost certainly slower, we had cpu cycles to spare but not enough storage.

Re:Zebras Hate You for No Reason: Why Amdahl's Law Is Mislea... by bombcar on Saturday December 03, 2022 @07:11PM (#33848982)
Reminds me of -OS being faster than -O3 in some cases, as by optimizing for size you minimize (slow) memory accesses on certain devices.
Re:Zebras Hate You for No Reason: Why Amdahl's Law Is Mislea... by jacquesm on Saturday December 03, 2022 @07:57PM (#33849327)
And you may well end up just fitting in the cache. Which is a huge speedup.