From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@9fans.net Date: Thu, 24 Feb 2011 10:09:30 +0000 From: comeau@panix.com (Greg Comeau) Message-ID: References: , Subject: Re: [9fans] Modern development language for Plan 9, Topicbox-Message-UUID: b3c238a4-ead6-11e9-9d60-3106f5b1d025 Some more info/thoughts to add to the gcc docs mentioned: http://www.comeaucomputing.com/4.0/docs/userman/ati.html In article , Federico G. Benavento wrote: >afaik, templates might be inlined, static or shared... depending on >the compiler and the flags. > >for gcc see: >http://gcc.gnu.org/onlinedocs/gcc/Template-Instantiation.html > > >On Fri, Feb 18, 2011 at 4:35 PM, David Leimbach wrote: >> >> >> Sent from my iPhone >> >> On Feb 18, 2011, at 11:15 AM, Bakul Shah wrot= >e: >> >>> On Fri, 18 Feb 2011 10:46:51 PST Rob Pike =C2=A0wrot= >e: >>>> The more you optimize, the better the odds you slow your program down. >>>> Optimization adds instructions and often data, in one of the >>>> paradoxes of engineering. =C2=A0In time, then, what you gain by >>>> "optimizing" increases cache pressure and slows the whole thing down. >>> >>> You need a feedback loop. =C2=A0Uncontrolled anything is a recipe >>> for disaster. Optimizations need to be `judicious' but that >>> requires experience, profiling and understanding but the >>> trend seems to be away from that..... >>> >>> On a slightly different tangent, 9p is simple but it doesn't >>> handle latency very well. =C2=A0To make efficient use of long fat >>> pipes you need more complex mechanisms -- there is no getting >>> around that fact. rsync & hg in spite of their complexity >>> beat the pants off replica. Their cache behavior is not very >>> relevant here. =C2=A0Similarly file readahead is usually a win. >>> >>>> C++ inlines a lot because microbenchmarks improve, but inline every >>>> modest function in a big program and you make the binary much bigger >>>> and blow the i-cache. >>> >>> That's a compiler fault. Surely modern compilers need to be >>> cache aware? ideally a smart compiler treats `inline' as a hint >>> at most, just like `register'. >>> >> >> Well how does template expansion affect all of this? =C2=A0I've heard in = >conversations that C++ is pretty register hungry which makes me think lots = >of inlining happens behind the scenes. =C2=A0Then again that's an implement= >ation detail, except maybe for templates. >> > > > >--=20 >Federico G. Benavento > -- Greg Comeau / 4.3.10.1 with C++0xisms now in beta! Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried it?