Monday, May 24, 2010

Why is ASM faster than C code?

The compilers all transform them into bytecode, don't they? Is it that the ASM compilers are just better than the C compiler?

Why is ASM faster than C code?
Starting with the caveat that not all asm programs are faster if they are not written by good asm programs then...





Yes, some hand asm code may be better than the best compiler optimized code. But beyond that C is written to a language standard that takes into account many different machine architectures and certain semantic guarantees. Honoring those may disallow using certain processor features that a particular asm program could potentially use because it is not operating within those constraints.


No comments:

Post a Comment