Artificial Intelligence
I think this is just wrong conversation, if you want to gain speed by replacing C code with ASM code you really need to know how to write optimized ASM code, and when you can that - you can gain speed UP to 50% (optimization, tricks, replacing commends with more UV friendly one, wery good algorith, counting every Hz of processor, houers of thinking).
Even to me as a C++ coder most of these assembler optimizations are just common knowledge. How much more obvious must your nifty tricks be to a compiler that has been tuned by hundreds of people to output high performance code ? Just realize that you're not the divine assembler geek that can get performance out of nowhere by applying some black magic here and there. The coders writing compiler are just as good at assembler as you are and probably know way more about the theory behind optimization that anybody on this board.
While it is delusional to think that assembler is by definition faster than anything else, there might still be some cases where it makes sense to optimize per hand. Central algorithms and loop running extremly frequently (use a profile to find bottle-necks) might be so important that the few percentages you can gain by optimizing per hand might make the difference. Nevertheless I fail to see why you would write everything in assembler just to optimize these 0.001 % of your source: Inline assembly has been invented for this very purpose.
Go ahead implementing your neutons in assembler if you happen to like the language or even the feeling of being a uber-hacker. Just don't fall for the old high performance myth that many still associate with assembler..
cheers,
gaf
While it is delusional to think that assembler is by definition faster than anything else, there might still be some cases where it makes sense to optimize per hand. Central algorithms and loop running extremly frequently (use a profile to find bottle-necks) might be so important that the few percentages you can gain by optimizing per hand might make the difference. Nevertheless I fail to see why you would write everything in assembler just to optimize these 0.001 % of your source: Inline assembly has been invented for this very purpose.
Go ahead implementing your neutons in assembler if you happen to like the language or even the feeling of being a uber-hacker. Just don't fall for the old high performance myth that many still associate with assembler..
cheers,
gaf
It is true that probably the best Assembly Language programmers have been picked-up for commerical compilers. GCC is taking care of the commercial compiler business in the C/C++ category, and we are not talking about the cream of the crop here... so I don't know how much longer that will hold.
Anyhow, another reason to know/use Assembly Language is that you can at least introduce some new instruction Opcodes through the use of macros in most x86 Assemblers. Compilers can take quite some time to come out with instruction use/optimizations for newer architectures.
Being able to read the specifications and do it yourself is a good quality/trait to have as a programmer.
Anyhow, another reason to know/use Assembly Language is that you can at least introduce some new instruction Opcodes through the use of macros in most x86 Assemblers. Compilers can take quite some time to come out with instruction use/optimizations for newer architectures.
Being able to read the specifications and do it yourself is a good quality/trait to have as a programmer.