Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Miles Bader Newsgroups: comp.lang.c++ Subject: Re: Oozing poison Date: Fri, 27 Jan 2012 18:09:07 +0900 Organization: NEC Electronics Lines: 31 Message-ID: References: <2f356856-3e59-442f-b711-bde8e13d8beb@o14g2000vbo.googlegroups.com> <9038aa7f-e263-4309-a67e-f70d2caafe26@t8g2000yqg.googlegroups.com> <9563593d-8d88-49a8-b390-e07b77d27faa@v14g2000yqh.googlegroups.com> <4f217fc2$0$4387$7b1e8fa0@news.nbl.fi> <9of1duF8j0U1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain X-Trace: individual.net MiNSHijnS940N36MnNNHrgJ3xkflGLIMqSVdzDCoAdSijcpARd Cancel-Lock: sha1:QsiX3+h2My3kiv/nTVy4pE1HEJ8= sha1:zSSvBhGTW/s1J1Mlw+/v+Ffxyok= System-Type: x86_64-unknown-linux-gnu Blat: Foop Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:13606 Ian Collins writes: > The only performance impact I have ever measured from the use of > exceptions is improvement. I have been testing compilers since the mid > 90s and I have only found one compiler/platform (that compiler refused > to inline any function that could throw) where exceptions had a > detrimental impact on performance. Yeah, generally exceptions are very cheap these days, probably cheaper than equivalently-safe explicit-return-value-checking code. I guess some of the people decrying them may be remembering some of the initial naive implementations using setjmp/longjmp (OK, I guess the exception handling in MS's 32-bit ABI is still kinda of stinky). > Yes you can end up with multiple instances of class methods, but that is > the price you pay for type safety. Anyway, what proportion of a decent > sized project would that represent? For containers of pointers one can > easily use inline wrappers round a container of void* to avoid bloat > while retaining type safety. In most code I have seen, containers of T* > are more numerous than containers of T Also note that for really equivalent template expansions, one can sometimes merge the resulting redundant functions at link-time. In gcc, for instance, using "-ffunction-sections" at compile-time, and "-Wl,--icf=safe" at link-time; I'm pretty sure MS's compilers have something equivalent. -Miles -- Love is a snowmobile racing across the tundra. Suddenly it flips over, pinning you underneath. At night the ice weasels come. --Nietzsche