<div dir="ltr">I think this is towards a good direction, but I want to understand what is going on more as 9% slowdown is somewhat significant.<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 9, 2016 at 7:11 PM, Rafael Espíndola <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">OK, looking at perf, what I got was that the "slow" instructions were<br>
<br>
<br>
mov    (%rcx,%rax,8),%rax<br>
mov    0x28(%rax),%rax<br>
mov    (%rax),%r13<br>
<br>
Which correspond to:<br>
 * given a symbol index, get the SymbolBody*<br>
 * get the backref<br>
 * get the repl<br>
<br>
I think these are only slow because we then proceed to use the data<br>
and pref blames the instruction that is computing the dependency of an<br>
expensive computations.<br></blockquote><div><br></div><div>Unless added to the symbol table, SymbolBodies does not have backrefs. Their backrefs are nullptrs. So I think for local symbols, that code would not be executed. Is this actually a bottleneck for local symbols?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The slowdown is because previously for local symbols we would branch<br>
out on the body being null.<br>
<br>
This suggests possible speed improvements:<br>
* Allocate SymbolBodies inline, like we do for SharedFile.<br>
* Use a bit of the pointer to cache if the SymbolBody is local or not.<br>
<br>
Given that there is a reasonable understanding, that other benchmarks<br>
(scylla) actually got faster and that the slowdown is not inherently<br>
because of the extra allocation, is the patch OK?<br>
<br>
Cheers,<br>
Rafael<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On 9 March 2016 at 18:21, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
> <a href="http://llvm.org/pr26878" rel="noreferrer" target="_blank">llvm.org/pr26878</a> has a case where we need to put a local symbol in the<br>
> got. Given that we have to allocate something to remember the got<br>
> index.<br>
><br>
> One way to do it is to create SymbolBodies. The attached patch does it<br>
> an has the potential of further simplifications.<br>
><br>
> Unfortunately with it I am seeing a 1.09X slowdown when linking clang.<br>
> The link line has --export-dynamic -O3 --gc-sections.<br>
><br>
> Cheers,<br>
> Rafael<br>
</div></div></blockquote></div><br></div></div>