<div class="gmail_quote">On Fri, Jul 1, 2011 at 8:07 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On Jul 1, 2011, at 3:45 PM, Argyrios Kyrtzidis wrote:<br>
<br>
> On Jul 1, 2011, at 12:28 PM, Zach Wheeler wrote:<br>
><br>
>> Looking at DiagnosticIDs.cpp again, it seems that he probably didn't store straight StringRefs because they would not pack efficiently for the short strings he was anticipating.<br>
>><br>
>> OK, I'm not following you. The compilation of /which file/ gets slowed down by constructor calls to /what object/, exactly?<br>
><br>
> DiagnosticIDs.cpp contains huge static arrays. Putting a StringRef into the struct there would make the struct non-POD and its constructor would have to be called, and since it is a global array all the constructor calls would occur in the global initializer function.<br>

> That caused a huge slow down when compiling that file but, apart from that, we generally try to avoid the need for global initializer functions as much as possible.<br>
<br>
</div>... especially because global initializer functions affect our startup time.<br>
<br>
        - Doug<br>
<br>
</blockquote></div><br><div>Thanks for clarifying Argyrios and Doug; I think I understand DiagnosticIDs.cpp better now.</div><div><br></div><div>Perhaps I'm being dense, but still I don't understand why the methods in Option.cpp have to call strlen so many times; it seems like there's a few ways around that. Did I misunderstand something?</div>
<div><br></div><div>ZJ</div>