zlacker

[parent] [thread] 2 comments
1. klabb3+(OP)[view] [source] 2024-01-23 23:06:00
I never do this kind of work so I can’t say. But if I did, I’d imagine I want more control. I mean, perf improvements are welcome to all code, but if I need a piece of code to have a specific optimization I’d rather opt-in through language constructs, so that the compiler (or other tooling) can tell me when it breaks. A well designed API with adapters from and to regular code would be better, no?

For instance, imagine I have auto-perf something and I check (manually mind you) the asm and all is good. Then someone changes the algorithm slightly, or another engineer adds a layer of indirection for some unrelated purpose, or maybe the compiler updates its code paths which misses some cases that were previously supported. And the optimization goes away silently.

replies(1): >>koala_+KG
2. koala_+KG[view] [source] 2024-01-24 05:16:55
>>klabb3+(OP)
Do you have the same view of other compiler optimizations? Would you prefer if the compiler never unrolled a loop so that you can write it out manually when you need it?
replies(1): >>klabb3+z13
◧◩
3. klabb3+z13[view] [source] [discussion] 2024-01-24 21:32:08
>>koala_+KG
No I wasn’t saying (or at least didn’t mean) the compiler shouldn’t optimize automatically. I meant that ensuring certain paths are optimizable could be important when you need it. And also that language constructs would be a good way to achieve that.
[go to top]