program speed vs programming language
Posted Jul 27, 2007 23:06 UTC (Fri) by
giraffedata (subscriber, #1954)
In reply to:
Still waiting for swap prefetch by briangmaddox
Parent article:
Still waiting for swap prefetch
Why stop at C, when it could be written in ASM?
That's not a natural progression. Code compiled from C is often faster than that compiled from assembly language, for the same reason that a computer can land an airplane more smoothly than a human. Even code compiled from C by a naive compiler (e.g. gcc -O0) is unlikely to be slower than code compiled from assembly language. C is that low-level a language.
how do you know the assembler will generate fast code, better do it in hex instead
We do know that. The assembler will generate code that is not only the same speed as that generated by the hex editor, but is actually the same code. That's the definition of assembly language.
I would have thought that after all these years that people would learn more about computer science and programming than to troll the "C is always faster than everything else" line.
The only line I saw was, "C is always faster than Python." And it is, isn't it?
(
Log in to post comments)