<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">Le 18 mars 2015 à 21:35, Sean Silva <<a href="mailto:chisophugis@gmail.com" class="">chisophugis@gmail.com</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Mar 17, 2015 at 9:36 PM, Davide Italiano <span dir="ltr" class=""><<a href="mailto:davide@freebsd.org" target="_blank" class="">davide@freebsd.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Mon, Mar 16, 2015 at 11:00 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:<br class="">
><br class="">
><br class="">
> On Mon, Mar 16, 2015 at 10:52 PM, Davide Italiano <<a href="mailto:davide@freebsd.org" class="">davide@freebsd.org</a>><br class="">
> wrote:<br class="">
>><br class="">
>> On Mon, Mar 16, 2015 at 1:54 AM, Davide Italiano <<a href="mailto:davide@freebsd.org" class="">davide@freebsd.org</a>><br class="">
>> wrote:<br class="">
>> ><br class="">
>> > Shankar's parallel for per-se didn't introduce any performance benefit<br class="">
>> > (or regression).<br class="">
>> > If the change I propose is safe, I would like to see Shankar's change<br class="">
>> > in (and this on top of it).<br class="">
>> > I have other related changes coming next, but I would like to tackle<br class="">
>> > them one at a time.<br class="">
>> ><br class="">
>><br class="">
>> Here's an update.<br class="">
>><br class="">
>> After <a href="http://reviews.llvm.org/D8372" target="_blank" class="">http://reviews.llvm.org/D8372</a> , I updated the profiling data.<br class="">
>><br class="">
>> <a href="https://people.freebsd.org/~davide/llvm/lld-03162015.svg" target="_blank" class="">https://people.freebsd.org/~davide/llvm/lld-03162015.svg</a><br class="">
>> It seems now 85% of CPU time is spent inside<br class="">
>> FileArchive::buildTableOfContents().<br class="">
>> In particular, 35% of the samples are spent inserting into<br class="">
>> unordered_map, so there's maybe something we can do differently there<br class="">
>> (e.g. , Rui's proposal of a concurrent map doesn't seem that bad).<br class="">
><br class="">
><br class="">
> Anyone tried a DenseMap instead of an unordered_map? If you need pointer<br class="">
> validity to the elements, a DenseMap with unique_ptrs rather than direct<br class="">
> values could be an option. Chandler's usual argument here is that walking<br class="">
> the map is cheap with high locality (as in a DenseMap) even if the nodes<br class="">
> themselves involve indirection. Could be worth an experiment.<br class="">
><br class="">
<br class="">
</span>I did now. It actually makes things slower for the aforementioned<br class="">
workload (linking clang). It was worth trying though.<br class="">
<br class="">
Patch, in case somebody wants to try at home:<br class="">
<a href="https://people.freebsd.org/~davide/llvm/densemap_membermap.diff" target="_blank" class="">https://people.freebsd.org/~davide/llvm/densemap_membermap.diff</a></blockquote><div class=""><br class=""></div><div class="">FYI we have StringMap which is specialized for strings. Also I'm sort of amazed that StringMap is using HashString (bernstein) instead of the fairly sophisticated hash functionality we have in ADT/Hashing.h</div><div class=""><br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>While StringMap is very useful, in lld we rarely need to have a copy of the StringRef keys that we can avoid by using DenseMap<StringRef>.</div><div>I don’t know it this is a significant memory of processor optimization though.</div><br class=""></div><div><br class=""></div><br class=""></body></html>