<div dir="ltr"><div dir="ltr">On Mon, Jun 21, 2021 at 6:28 PM Alexander Yermolovich <<a href="mailto:ayermolo@fb.com">ayermolo@fb.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
Hello David<br>
<br>
I haven't dug into llvm-dwp performance. What are some of the performance pain points that you know about?<br></div></div></blockquote><div><br>Yeah - using LLVM's higher level abstractions for writing object files (MCStreamer et, al) means that, as far as I recall, all the output ends up buffered in memory before being written out - whereas, ideally, it'd be streamed (memcpy to/from memory mapped files) from input file to output file (potentially through streamed compression/decompression where possible too - another layer of the MCStreamer abstractions that can add cost (though I don't think I implemented support for compressing output in llvm-dwp, though it'd be trivial to add because it's already supported in MCStreamer (but that support does buffer the whole uncompressed and compressed data... ))). Maybe some other things, but that's certainly the top of my list.<br><br>- Dave<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
Thank You<br>
Alex</div>
<div id="gmail-m_-8798475053668546221appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-8798475053668546221divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Alexander Yermolovich<br>
<b>Sent:</b> Monday, June 21, 2021 6:11 PM<br>
<b>To:</b> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a> <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>
<b>Cc:</b> <a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a> <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>>; Maksim Panchenko <<a href="mailto:maks@fb.com" target="_blank">maks@fb.com</a>><br>
<b>Subject:</b> [RFC] Refactor llvm-dwp in to a library.</font>
<div> </div>
</div>

<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
Hello<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
I am working on adding support for bolt (<a href="https://github.com/facebookincubator/BOLT/tree/rebased" id="gmail-m_-8798475053668546221LPlnk635887" target="_blank">https://github.com/facebookincubator/BOLT/tree/rebased</a>) to write out DWP directly.  I want to re-use as much llvm-dwp functionality as
 possible. <br>
Plan is to move most of functionality that is now in llvm-dwp in to llvm/lib/DWP, with corresponding header file in llvm/include/llvm/DWP.<br>
In the header files have<br>
getContributionIndex<br>
handleSection<br>
parseCompileUnitHeader<br>
writeStringsAndOffsets<br>
getCUIdentifiers<br>
buildDuplicateError<br>
writeIndex<br>
<br>
<span style="background-color:rgb(255,255,255)">For structs that are passed around define in the header also.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Menlo,Monaco,"Courier New",monospace;font-weight:normal;font-size:12px;line-height:18px">
<span><span style="color:rgb(78,201,176);background-color:rgb(255,255,255)">UnitIndexEntry</span></span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Menlo,Monaco,"Courier New",monospace;font-weight:normal;font-size:12px;line-height:18px">
<span><span style="color:rgb(78,201,176);background-color:rgb(255,255,255)">CompileUnitHeader</span></span></div>
<div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Menlo,Monaco,"Courier New",monospace;font-weight:normal;font-size:12px;line-height:18px">
<span><span style="color:rgb(78,201,176);background-color:rgb(255,255,255)">CompileUnitIdentifiers</span></span></div>
<br>
</div>
<br>
Thought I would solicit opinions before I dive too deep into this. <br>
<br>
Thank You<br>
Alex</div>
</div>
</div>

</blockquote></div></div>