Indeed. Often the slowest code for us is due to cache friendliness more than algorithmic complexity.
For the data to be laid out correctly the problem needs to be solved way earlier in your toolchain as well as downstream with a rewrite of any algorithm that touches it
Good luck with that. Yes, a compiler will do a good job with i * 28, but the optimization in the article - which is a pretty simple case, chosen to fit in a blog post - requires manipulating the algorithm beyond the capability of any compiler I'm aware of.
We do have good tooling to show what code is slow, for instance, so it's not like automation doesn't help here.