<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 18, 2014 at 4:32 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Thu, Sep 18, 2014 at 4:20 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Now, there are 300_000 options in the response file, but adding a<br>
counter to ] llvm::opt::Option::matches shows that it is called about<br>
349_802_000 times :-)<br>
<br>
Is this a now issue? Is it worth fixing?<br></blockquote><div><br></div></span><div>It's sort of a known issue, but only by inspection. If you've ever looked at the driver, there are all these calls to getLastArg(ID), AddAllArgs(ID1, ID2) and things of that nature. They *all* iterate the whole argument list.</div><div><br></div><div>We could probably make this much more efficient by mapping the arguments into a table indexed by option ID and doing lookup on that. We would still need to preserve order information, though.</div><div><br></div><div>I think when Daniel Dunbar wrote all this, everyone agreed that command line parsing would never be hot, so it was done expediently and without consideration for efficiency. Previously strings were not allocated form a pool, they were merely malloc'd and leaked. The leaks aren't really that bad, considering that the command line has to live for roughly the driver's whole life.</div></div></div></div></blockquote><div><br></div><div>Unless clang is being used as a library...</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div></div>