So-so debate of speed with asm and C
Posted 27 September 2009 - 07:13 PM
If I say otherwise, there are people telling the opposite; compilers these days are fast enough to beat hand written assembly.
I wonder, how is it really? I guess it is case-specific, but is there any general ruling to this, as in under which circumstances C or asm is notably faster/slower than the other, if any? Any empiric experience?
And most importantly, any proof for the claims? I've never seen any decent comparison really.
Useles topic, but meh. I need to know. :(
Posted 27 September 2009 - 08:17 PM
- www.mattiasgustavsson.com - My blog and current projects
- www.rivtind.com - My Fantasy world and isometric RPG engine
- www.pixieuniversity.com - My Software 2D Game Engine
Posted 27 September 2009 - 09:21 PM
I shouldnt really post here cause i know stuff all asm and all my code is really crap and slow. :) hehehe
Posted 28 September 2009 - 12:09 AM
Posted 28 September 2009 - 06:35 AM
Posted 28 September 2009 - 08:20 AM
Posted 28 September 2009 - 02:08 PM
size-wise I guess that asm is still the king, just look at how many 4k demos are there written in asm/C. This interests me quite alot, as 4k prods seem to be more and more something I would like to take attempt at. gcc + strip + upx + few other tricks seem to be able to cut down the binary size quite damn well for C, but I believe asm is still quite much required to be able to fit actual content in 4096 bytes.
...however, thats not why I created the thread, size advantage is obvious.
Posted 28 September 2009 - 04:14 PM
Conclusion: we are all aware of the difference, but the languages exist for a reason. The compiler does a bad job? Yes, it's a well known fact, compilers use heuristics, hand-written assembler is much faster!
Depends on your idea and compiler.
Posted 28 September 2009 - 04:40 PM
Probably one of the most influential demonstrations showing how raw ASM can outperform your typical compiler code generation. Mandelbrot is a very easy equation to implement, but a standard C/C++ implementation generates no where near that level of performance.
If you have the time and cunning, ASM can make a significantly positive impact on performance.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users