[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C++ religious war (was: llua Higher-level C API for Lua)
- From: David Crayford <dcrayford@...>
- Date: Sun, 16 Mar 2014 19:37:43 +0800
On 16/03/2014 4:06 PM, steve donovan wrote:
However, everything has costs - that 'ruthless inlining' can really
give you fat executables, since this is the default behaviour for
templates - and in modern C++, just about everything is a template,
whether sensible (standard containers) or not (strings and iostreams).
Again, because of templates, compile times become intense and error
messages become the stuff of legend.
Even C can give you fat executables. What with loop unrolling and the
strange instruction scheduling that
the optimizer generates for modern processors. The compiler I use goes
out of it's way to avoid branches. Sometimes
a small loop can be unrolled into a hundred instructions using
load-on-condition/store-on-condition instructions. A memcpy()
when the length is constant can generate 20-30 move instructions. It's a
space for time trade-off.