<div class="gmail_quote">On Tue Jan 13 2015 at 12:46:57 PM David Chisnall <<a href="mailto:David.Chisnall@cl.cam.ac.uk">David.Chisnall@cl.cam.ac.uk</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 13 Jan 2015, at 11:17, Manuel Klimek <<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>> wrote:<br>
><br>
> On Tue Jan 13 2015 at 12:13:53 PM John Sully <<a href="mailto:john@csquare.ca" target="_blank">john@csquare.ca</a>> wrote:<br>
> > The problem is that most of the time is spent throughout various functions of Sema in clang, so the only way I see is to have every function in Sema check for abortion, which sounds like it would horribly clutter the code...<br>
><br>
> I don't think it needs to be that extreme.  Once every 100ms would be sufficient for my purposes which would drastically reduce the number of checks needed.  My own profiles are also showing a fair amount of time in the Lex code as well.  I'm still learning the code but I suspect it would be feasible to check in-between major phases.<br>
><br>
> I suspect it won't, but feel free to give it a try - for really long TUs we see all of the time spent in Sema trying to parse C++, and it's basically a flat profile.<br>
<br>
A check in Sema at the start of processing each FunctionDecl might be enough.  Even long functions with a lot of template instantiations probably don't take more than 100ms in most code.  Unless you're trying to use libclang with the raytracer written in C++ templates or something equally silly (boost, perhaps)...<br></blockquote><div><br></div><div>That would definitely help already. Great idea.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
David<br>
<br>
</blockquote></div>