Re:Ask HN: What is your best advice for a developer to write...
by nwmcsween on Wednesday June 29, 2016 @04:20PM
(#12004501)
You have to be clever sometimes, take strlen in C you could do byte at a time which a compiler will vectorize or you could do SWAR with some fancy bit hacks and get a large perf boost.
[ Parent
| on HN ]
Re:Ask HN: What is your best advice for a developer to write...
by nameless912 on Thursday June 30, 2016 @05:17PM
(#12011803)
A better statement might be: "Don't be clever, let others be clever for you."
Obviously, stdlib functions are going to be highly optimized and the compiler will put hardware-specific performance hacks in for your benefit. Smarter people than you wrote, vetted, and approved that code. Use it, and don't ever try to be that smart yourself.