3 ms·
My question is in the context of doing those optimizations yourself, understanding what can be done to make the code more efficient and how to code it up, not t
by mgaunard 10mo ago
My question is in the context of doing those optimizations yourself, understanding what can be done to make the code more efficient and how to code it up, not the compiler engineering to make that happen.
- nickysielicki 10mo agoYikes, gross. That’s like an option of last resort IMO. I’d rather maintain the clean loop-based code unless I had evidence that the compiler was doing the wrong thing and it was in my critical path.
- mgaunard 10mo agoThe compiler is only able to perform certain optimizations that have no observable behaviour. For example it can only parallelize code which is inherently parallelizable to begin with, and unless you design your algorithm with that in mind, it's unlikely to be. My belief is that it's better to be explicit, be it with low-level or high-level abstractions.