News for hackers. Stuff that matters.
Re:Why performance optimization is hard work by tikotus on Tuesday April 29, 2025 @01:20PM (#43835456)
I once had this kind of body recovery/stress level measuring thingy on me for a few days, and a doctor would then analyze my health and such. I was under some stress those days and (according to the measurements) I wasn't recovering properly even during the nights. But then there was this one, long, flat, deep green curve in the middle of my work day. I checked from my VCS what I was doing during that period: I was optimizing.

I've since noticed this many times. Optimizing is like meditation to me. It's very mechanical (measure), with a sprinkle of creative work (once you know what is slow, it's quite obvious how to make it faster, but just challenging enough to be engaging), and it has a very nice tight feedback loop: Something is slow. I make a change. Now it's fast. Next.

Optimizing is my happy place.

Re:Why performance optimization is hard work by AaronAPU on Tuesday April 29, 2025 @03:18PM (#43836849)
I spent 10 years straight doing C++ and assembly optimization. My work is still fun these days but that was probably the most enjoyable work of my career in terms of the actual day to day coding.

Code cleanup in general is the same for me, but it’s really hard to justify putting much time into that when running your own company solo.

Re:Why performance optimization is hard work by jasonthorsness on Tuesday April 29, 2025 @03:23PM (#43836903)
What tools did you use to assess the results of your changes?
Re:Why performance optimization is hard work by AaronAPU on Tuesday April 29, 2025 @04:35PM (#43837737)
The routines were individually benchmarked using some custom tools (iterate repeatedly and use statistical analysis to converge on an estimate). Always compared against a plain C reference implementation.

Then there was a system for benchmarking the software as a whole on a wide variety of architectures, including NUMA. With lots of plots and statistics.

Usually you’d eventually end up at a point where the improvements are below the noise floor or they help on some systems and cause regression on others. The rule was usually “no regressions”

VTune for multithreading optimization. Built a fibers and lockfree system for efficient scheduling.

Re:Why performance optimization is hard work by ecshafer on Tuesday April 29, 2025 @08:58PM (#43840001)
That sounds like a pretty good set up with a lot of investment, HFT shop?
Re:Why performance optimization is hard work by AaronAPU on Wednesday April 30, 2025 @02:00PM (#43848722)
Codecs
Re:Why performance optimization is hard work by toomuchtodo on Tuesday April 29, 2025 @01:30PM (#43835560)
Re:Why performance optimization is hard work by optymizer on Tuesday April 29, 2025 @04:03PM (#43837384)
I see you.
Re:Why performance optimization is hard work by 01HNNWZ0MV43FF on Tuesday April 29, 2025 @01:23PM (#43835485)
I remember one fun time between jobs, that I stayed up till 4 or 5 am optimizing something. It always felt like I was making progress and about to beat the original implementation

Unfortunately I had to give up when I was still 10 times slower than the reference lol

Re:Why performance optimization is hard work by senderista on Tuesday April 29, 2025 @02:04PM (#43835988)
Same here, last time I was between jobs I optimized my defunct startup's database from ~50K TPS to nearly 5M TPS (no durability, if you're wondering), and that was unbelievably rewarding.
Re:Why performance optimization is hard work by zahlman on Tuesday April 29, 2025 @06:56PM (#43839037)
> Optimizing is my happy place.

Interesting. For me, it's refactoring.

Re:Why performance optimization is hard work by YZF on Wednesday April 30, 2025 @01:56AM (#43841688)
I also love optimization work. There can be a lot of creativity when it comes to reinventing how something is done. I've seen an algorithm taken to x10 after a ton of optimization by some insane SIMD techniques.

It seems there's less appreciation for this kind of work these days.

Re:Why performance optimization is hard work by singhrac on Wednesday April 30, 2025 @03:20AM (#43842139)
There’s nothing quite like writing the final squashed commit message and saying “results should be bit-level identical, +25% speedup on average” or the equivalent. Even better if it’s a hot path that matters to the bottom line of the company.

I try to keep a few of these tasks lying around marked “unblocked” in case I need to unwind. It keeps me from doing it right after noticing, which is an extra bonus.

Re:Why performance optimization is hard work by devnull3 on Wednesday April 30, 2025 @03:25AM (#43842164)
I think optimization triggers fundamental instincts in humans:

1. Tracking i.e. navigating through jungles for hunting or find where the bottleneck is.

2. The thrill of the hunt. The joy after finding the hotspot or the bottleneck. It makes your day.

3. The actual hunt i.e. shooting an arrow/spear or using clever way of fixing.

4. Brag about the hunt or writing a blog post or tech talk on how difficult and awesome the hunt was.

Also optimizing a critical path has multiple takers in the org:

1. Product Managers are happy due to improved user experience.

2. Management is happy as in some cases it actually saves a lot of money.

3. Your boss is happy because he/she gets to score points as "team achievement" when evaluation is around the corner.

4. Engineers get to do nerdy things which otherwise would not find traction in the org.

All in all its a win-win-win-* situation.

Re:Why performance optimization is hard work by Jean-Papoulos on Wednesday April 30, 2025 @09:49AM (#43845219)
Ah yes, completely unfounded behavioral "science" to explain a modern thing. My favorite.
Re:Why performance optimization is hard work by dkersten on Wednesday April 30, 2025 @05:07AM (#43842800)
I also love optimising, especially low level code.
Re:Why performance optimization is hard work by MawKKe on Wednesday April 30, 2025 @05:20AM (#43842871)
Was the need for optimization work something that was on your mind the whole time? Like a nagging feeling in the back of the head that the code is not working as well as it _should_ be working? i.e. stress.

And when you finally "fixed" the issue through optimization, your mind allowed itself to let go of these open loops (borrowing the GTD terminology), leading to relaxation?

Re:Why performance optimization is hard work by phanimahesh on Wednesday April 30, 2025 @08:00AM (#43843980)
Might explain why factorion is so popular. Not just factorion but the entire genre of games it spawned
Re:Why performance optimization is hard work by kristianp on Wednesday April 30, 2025 @07:00PM (#43851655)
Performance articles are often the most popular on HN. This explains why.