3 ms·
Writing SSE by hand can sometimes give you over a 10x speedup in an inner loop of a computationally expensive problem [..] a clever programmer will always be ab
by petercooper 13y ago
Writing SSE by hand can sometimes give you over a 10x speedup in an inner loop of a computationally expensive problem [..] a clever programmer will always be able to boost performance more than a compiler.
Right now, but I think future proofing is another issue to keep in mind alongside portability. CPUs in, say, 5 years are likely to have alternative and more powerful ways of dealing with certain things, and a good optimizing compiler should (optimistically!) be able to compile older code to run even more quickly on newer CPUs than hand coded assembly might allow.
I'm not sure how much impact this issue has in something like the Linux kernel, say, but I could imagine if significant parts of the kernel were written in i386-level x86, it would be a big issue now and demand much rewriting compared to C. (But I could be wrong as I'm not a kernel hacker, and would appreciate expert insight here ;-))
- benjamincburns 13y agoI think this is a really good point. It's worth adding that this has been much less of an issue in the past than it will be in the future, as until recently you could always count on increased clock speed. By not being architecture-flexible, your code is basically stuck with today's performance. That said, for some algorithms there's a decent chance that "today's performance" is about what we can expect 20 years from now, so maybe hand-optimization is beneficial.