3 ms·
Not sure if you saw the blog post I referenced that was trending here last week. These types of optimizations often turn out to be underwhelming.
by chrissnell 9y ago
Not sure if you saw the blog post I referenced that was trending here last week. These types of optimizations often turn out to be underwhelming.
- eloff 9y agoNot true at all, there are 20-50x speedups for some of the functions that have been optimized into Go assembly. Specific cryptography routines for which CPUs have dedicated instructions. Those are the kinds of places where you'd use it. If you want to write assembly because you think you can generate better code than the compiler, you probably can, but it also almost certainly will be underwhelming as you say. It's only really worth it when you're using instructions the compiler won't emit, like specialized crypto, math, bit counting instructions, or SIMD instructions.
- dungle6 9y agoOften is very much not the same as always. Moreover, when these optimizations are useful (i.e. Not underwhelming) the payoff is significant (like multiple orders of magnitude significant). Additionally crypto is special due to side channel issues of course. Anyway most compilers are generally shit at vectorization generally.