Linked by Thom Holwerda on Mon 29th Jun 2009 20:47 UTC
Hardware, Embedded Systems In our latest podcast Kroc and I again talk about the trboules facing netbooks, and we solely place the blame on software not taking proper advantage of the hardware, and OEMs picking the wrong software to begin with. There's two ways to solve this: better software, or faster hardware. It seems like the industry will move to the latter.
Thread beginning with comment 370803
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: Performance? Hmm...
by PlatformAgnostic on Tue 30th Jun 2009 04:29 UTC in reply to "RE: Performance? Hmm..."
PlatformAgnostic
Member since:
2006-01-02

While I agree with what you're saying about the people who use high-level languages and stupidly complex algorithms, you get no points for using inline assembly. With modern, competent compilers (e.g. gcc, msvc, sun studio, etc), the compiler will likely choose a good code sequence to balance size and speed. Especially if you give it some feedback in the form of profile-guided optimization. Inline asm sometimes inhibits the compiler's optimizer and generally is a waste of time if you're good enough to write clear, straightforward-to-optimize C code without too many pointers flying about (to avoid aliasing deoptimizations).

The real trick lies in writing straightforward, maintainable code for the bulk of your program so that the compiler will do a good job, and then tweaking the C code (or using processor intrinsics where there's a not-normally-generated instruction that will help you out) to get the instruction output you want from the compiler. Chances are good that you'll get it with a modern compiler, even if you don't resort to stupid tricks with the >>, XOR, or AND operators or manually strength-reducing divisions.

Reply Parent Bookmark Score: 2