?

Log in

No account? Create an account
   Journal    Friends    Archive    Profile    Memories
 

Naked C wins - morfizm

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

Naked C Wins

7 comments - Leave a commentPrevious Entry Share Next Entry

Comments:

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

Naked C wins

(Link)
User gineer referenced to your post from Naked C wins saying: [...] Originally posted by at Naked C wins [...]
From:passerbyp
Date:October 9th, 2016 09:07 pm (UTC)
(Link)
If C naked then where assembler skeleton?
From:rezkiy
Date:October 11th, 2016 04:10 pm (UTC)
(Link)
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).
From:passerbyp
Date:October 11th, 2016 11:45 pm (UTC)
(Link)
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...
From:morfizm
Date:October 11th, 2016 11:59 pm (UTC)
(Link)
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.

From:passerbyp
Date:October 12th, 2016 12:04 am (UTC)
(Link)
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!
From:(Anonymous)
Date:October 9th, 2016 10:14 pm (UTC)
(Link)
Nice, nice :)