<div dir="ltr">Most programs I use don't use linker scripts at all (which is a good thing).Is Linux kernel a good test case? I wonder if it is sufficiently large so that benchmark numbers make sense.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 19, 2017 at 4:52 PM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I really don't expect this to be too expensive.<br>
<br>
The cost is proportional to the number or orphan sections, which is<br>
hopefully very small.<br>
<br>
That does remind me that I don't have any testcase that uses a<br>
linkerscript in the benchmark set I use. Any suggestions of a program to<br>
add?<br>
<br>
Cheers,<br>
Rafael<br>
<div class="HOEnZb"><div class="h5"><br>
Rui Ueyama via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> writes:<br>
<br>
> ruiu added a comment.<br>
><br>
>> I performed a quck test which tries to simulate the situation (<a href="https://ideone.com/p07NYi" rel="noreferrer" target="_blank">https://ideone.com/p07NYi</a>). It calls some method log() which do nothing with random string argument million of times.<br>
>>  Like if we would have script with million of orphans and verbose set to off. It takes 80 milliseconds in total. That probably can be considered as the approximation of worst possible scenario ?<br>
><br>
> Well, I do not believe that the cost of calling `log` really matters, but your test doesn't seem to test it correctly. We are talking about the cost of calling toString on `InputSectionBase *`. I don't think it makes much sense to write some different function and measure its performance on dummy inputs. Why don't you just profile it?<br>
><br>
><br>
> <a href="https://reviews.llvm.org/D37517" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D37517</a><br>
</div></div></blockquote></div><br></div>