??? 05/13/09 12:59 Read: times |
#165293 - The opinion that assembler is faster than C Responding to: ???'s previous message |
Richard Erlacher said:This particular function will go VERY fast in the manner I've cursorily described, use very limited resources, and, I'm quite well persuaded, would be much slower in 'C'
Andy replied :A decent 'C' compiler can make good use of lookup tables as you describe - so it still might not be that bad. Then again, it might be. The opinion that assembler is faster than C is often correct. if you compare C without any concern (e.g. using the 'large' model) to well crafted assembler it is, indeed true. I have, however seen examples of qualified C coders writing assembler with very little understanding of the hardware and ending up with assembler that was worse than their C. However for a person well versed in both C and assembler, it can be beneficial to write a function or two in asm for reasons of throughput. Erik |