Log in

No account? Create an account
   Journal    Friends    Archive    Profile    Memories


Oct. 9th, 2016 05:56 am Naked C wins

Naked C Wins

7 comments - Leave a commentPrevious Entry Share Next Entry


Date:October 9th, 2016 03:58 pm (UTC)

Naked C wins

User gineer referenced to your post from Naked C wins saying: [...] Originally posted by at Naked C wins [...]
Date:October 9th, 2016 09:07 pm (UTC)
If C naked then where assembler skeleton?
Date:October 11th, 2016 04:10 pm (UTC)
it is very hard to outrun well-written C code with handwritten assembly. More, it is even harder to outrun well-written cpp with C (as 99.9% of C is legit cpp).
Date:October 11th, 2016 11:45 pm (UTC)
Well... well-written against handwritten? How about well-written against well-written? If we're take performance then assembler will outrun C and C++ indeed... Another word, it depends how well-written it...
Date:October 11th, 2016 11:59 pm (UTC)
rezkiy's point was C and CPP compilers are so good that well-written (without obviously wrong data structure choices, etc) code will generally produce more optimized assembly that one can well-write manually.

And this is a true point; it wasn't true in, say, 2000 but it's closer to true since about 2005-2007, and very true today. Especially if we're talking about 64 bit code with plenty of registers that optimizing compiler may shuffle and re-purpose as it wants, in really non-intuitive combinations. I am not talking just about passing parameters and returning values, I am also talking about optimizing registers for all sorts of temps like loop vars, etc.

Date:October 12th, 2016 12:04 am (UTC)
Optimizing registers? If I wrote this optimization in assembler and now C compilers generate my assembler code maybe I can improve it? I think so... Never say never!
Date:October 9th, 2016 10:14 pm (UTC)
Nice, nice :)