<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 17, 2016 at 8:38 AM, 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">I did a quick and dirty experiment to use large pages when a hash<br>
table gets big. The results for lld are pretty impressive (see<br>
attached file, but basically 1.04X faster link of files with debug<br>
info).<br>
<br>
I tested disabling madvise and the performance goes back to what it<br>
was, so it is really the large pages that improves the performance.<br>
<br>
The main question is then what the interface should look like. On<br>
linux the abstraction could be<br>
<br>
std::pair<void *, size_t> mallocLarge(size_t Size);<br>
<br>
which return the allocated memory and how much was actually allocated.<br>
The pointer can be passed to free once it is no longer needed.<br></blockquote><div><br></div><div>I wonder why you want to return a size instead of just a void pointer.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The fallback implementation just calls malloc and returns Size unmodified.<br>
<br>
On linux x86_64 if size is larger than 2MiB we use posix_memalign and madvise.<br>
<br>
Would the same interface work on windows?<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div></div>