??? 05/05/08 21:18 Read: times |
#154453 - Two kinds of "efficiency" Responding to: ???'s previous message |
Erik said:
no, just "efficient C".
if you start here http://www.8052.com/forumchat/read.phtml?id=154434 with my example and continue with your response, you have an example. Yeah, okay. I see what you mean. So I guess we've really identified two flavors of "efficient C". One would be C that's crafted in specific ways to help a specific compiler produce better code. Examples of this would be your original "buffer + 8" snippet and my comments about replacing (a * 8) with (a << 3), etc. I'd maintain that this kind of thing has increasingly limited value as compilers get better and better. These days, in situations that are so critical that you start thinking of ways to help out the compiler, you might be better off thinking about assembly language instead. The other kind of "efficient C" is the "Hey, don't be stupid" variety shown by the improvement you made in the "ReadPagedFlashC()" example. Of course, the admonition to avoid stupidity applies equally across all languages and platforms, even if that stupidity is sometimes hard to see when it's buried among lotsa gigahertz and megabytes. -- Russ |
Topic | Author | Date |
"Real C" vs '51 C | 01/01/70 00:00 | |
there is nothing wrong except... | 01/01/70 00:00 | |
if you are not , why are you even here | 01/01/70 00:00 | |
*(buffer+8+index)? | 01/01/70 00:00 | |
none of the above | 01/01/70 00:00 | |
OK then how? | 01/01/70 00:00 | |
like this | 01/01/70 00:00 | |
but it's basically the same... | 01/01/70 00:00 | |
YCMV | 01/01/70 00:00 | |
No | 01/01/70 00:00 | |
assumptions | 01/01/70 00:00 | |
Re: assumptions | 01/01/70 00:00 | |
I took a \'known\' example | 01/01/70 00:00 | |
Compiler-independent efficient C | 01/01/70 00:00 | |
a clarification and an example | 01/01/70 00:00 | |
Two kinds of "efficiency" | 01/01/70 00:00 | |
Compiler smarter than coder | 01/01/70 00:00 | |
Getting the least out of your compiler | 01/01/70 00:00 | |
Real C is inherently reentrant | 01/01/70 00:00 | |
which, even when possible, often is ill advised | 01/01/70 00:00 |