View Single Post
  #38   Spotlight this post!  
Unread 31-12-2002, 11:13
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
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.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php