I disagree with this post (edit: specifically, that Blow’s comment isn’t valid for all languages). The first order of performance gains is most often attained algorithmically, e.g. choice of data structures, caching results of lengthy operations, being clever about when you want to do work. This can be achieved without having explicit memory control or access to intrinsics, so regardless of language. This often comes intuitively. So what Jonathan Blow said applies regardless of language, whether you think he's correct or not.
Using SIMD intrinsics and optimizing your data layout comes after. There is no use in doing those sorts of optimization on work you can eliminate (as much as I love doing them). Nothing is as cheap as work you don't have to do. But inevitably there are operations you need to run on huge datasets that you can't eliminate, or cache, etc., and then extracting maximum throughput from the hardware through such techniques gives you a leg up over languages that don't give you this sort of control.
Also, auto-vectorization is hardly something to judge a compiler's cleverness by. It is a super obvious optimization that compilers have performed for a long time (even taking into account that the post is from 2016). Having done a lot of optimization work on video games, Microsoft's compiler fares well with those sorts of optimizations.
2
u/stingoh May 25 '19 edited May 26 '19
I disagree with this post (edit: specifically, that Blow’s comment isn’t valid for all languages). The first order of performance gains is most often attained algorithmically, e.g. choice of data structures, caching results of lengthy operations, being clever about when you want to do work. This can be achieved without having explicit memory control or access to intrinsics, so regardless of language. This often comes intuitively. So what Jonathan Blow said applies regardless of language, whether you think he's correct or not.
Using SIMD intrinsics and optimizing your data layout comes after. There is no use in doing those sorts of optimization on work you can eliminate (as much as I love doing them). Nothing is as cheap as work you don't have to do. But inevitably there are operations you need to run on huge datasets that you can't eliminate, or cache, etc., and then extracting maximum throughput from the hardware through such techniques gives you a leg up over languages that don't give you this sort of control.
Also, auto-vectorization is hardly something to judge a compiler's cleverness by. It is a super obvious optimization that compilers have performed for a long time (even taking into account that the post is from 2016). Having done a lot of optimization work on video games, Microsoft's compiler fares well with those sorts of optimizations.
(edit: added last paragraph)