From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Mon, 29 Oct 2012 09:35:00 -0400 To: 9fans@9fans.net Message-ID: <4824335454f1b1d47dbc8439b4af8ea3@kw.quanstro.net> In-Reply-To: <15723310.yIARpoJMSL@coil> References: <15723310.yIARpoJMSL@coil> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] caveat... optimizer? the `zero and forget' thread on HN Topicbox-Message-UUID: cb9bc3ae-ead7-11e9-9d60-3106f5b1d025 On Mon Oct 29 05:47:10 EDT 2012, dexen.devries@gmail.com wrote: > http://news.ycombinator.com/item?id=4711346 > > 9fans says, ``no room in the compiler world for amateurs''. what's your take > on the above fubar? any sort of "advanced" code-moving optimization is confusing. but the way c/c++ are used in linux, bsd & osx, there is a noticable benefit to optimizing calls away. it takes smarts to optimize away those recursive wrapper macros. so they're in a bit of a pickle. i just wonder if this isn't a race to the bottom. tricks like this require programmers to think harder about non-problems, and probablly write defensive inlines, etc. the compiler writers won't accept this slowdown and will try to outwit the defensive inlines on the theory that programmers aren't that keen. LWN carries story on these sorts of self-inflicted wounds every so often. the last one was on __access_once or something like that. it goes without saying, i think a compiler that largely does what you ask it to optimizes the scarce resource: developer time. i'm sure you'll find smarter opinions from smarter people, though. :-) - erik