Quote:
Originally posted by Matt Leese
That's a bit of a "urban legend." Hand-crafted assembly can be significantly faster than what is output by a compiler, even with all optimizations turned on. It's the simple fact that when writing in assembly you can tell the processor to only do what you really need it to do at a much lower level than that of a higher-level language.
That said, the most useful part of assembly these days is the fact that it will result in an executable of much smaller size. There's a significant amount of overhead involved with a higher-level language that can be avoided by writing in assembly. Now why does size matter with huge hard drives being cheap? Embedded systems.
Matt
|
I agree. Assembly
can be faster than a compiled language. On the other hand, if you don't know what you're doing, you have the potential to royally destroy the processor pipeline. It's gotten much better with branch prediction, but it still isn't perfect.
Anyway, slashdot had a story a while back on tiny binaries using assembly. It's a good read and available
here.