<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jan 10, 2012, at 12:20 AM, David Blaikie wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><blockquote type="cite">By repeatedly, you mean in each translation unit, right? Because we<br></blockquote><blockquote type="cite">shouldn't have to visit them more than once per TU (we won't be<br></blockquote><blockquote type="cite">visiting them per insntantiation). But, yes, the idea of analyzing<br></blockquote><blockquote type="cite">every boost template someone includes when they're only using a subset<br></blockquote><blockquote type="cite">does sound a little costly - I might be interested to compare times,<br></blockquote><blockquote type="cite">though.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Only analyzing instantiated templates (& keeping a list of those<br></blockquote><blockquote type="cite">templates we've already seen/analyzed) seems OK to me, assuming that<br></blockquote><blockquote type="cite">didn't represent a prohibitive memory cost to maintain the set of<br></blockquote><blockquote type="cite">visited templates (can't see why it should, but it is a small<br></blockquote><blockquote type="cite">time/space tradeoff all the same).<br></blockquote><br>Is there a particular technique/suite/process I should use to try to<br>measure the possible performance regression of performing reachable<br>code analysis on all templates? (of course I may need to come up with<br>my own test cases using the STL and/or boost to really grind things a<br>bit)</div></span></blockquote></div><br><div>Two thoughts:</div><div><br></div><div>(1) My main concern is Boost and STL, which are commonly used.  If you notice a significant performance regression on code that uses either, that's very concerning.  What kind of performance loss are you seeing on your test cases?</div><div><br></div><div>(2) As a performance optimization, we could only analyzing uninstantiated templates that are actually instantiated.  This means that some code won't get checked immediately, but doing otherwise doesn't seem to match the "pay-for-what-you-use" model of C++.  That could recover some of the performance loss being observed in (1) to the point where things are acceptable.</div><div><br></div><div>Thanks again for working on this.</div></body></html>