logoalt Hacker News

nickysielickiyesterday at 10:12 PM1 replyview on HN

Yikes, 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.


Replies

mgaunardyesterday at 10:53 PM

The 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.