[RFC] Using large pages for large hash tables

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 09:04:36 PDT 2016

On Mon, Oct 17, 2016 at 8:38 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> I did a quick and dirty experiment to use large pages when a hash
> table gets big. The results for lld are pretty impressive (see
> attached file, but basically 1.04X faster link of files with debug
> info).
> I tested disabling madvise and the performance goes back to what it
> was, so it is really the large pages that improves the performance.
> The main question is then what the interface should look like. On
> linux the abstraction could be
> std::pair<void *, size_t> mallocLarge(size_t Size);
> which return the allocated memory and how much was actually allocated.
> The pointer can be passed to free once it is no longer needed.

I wonder why you want to return a size instead of just a void pointer.

> The fallback implementation just calls malloc and returns Size unmodified.
> On linux x86_64 if size is larger than 2MiB we use posix_memalign and
> madvise.
> Would the same interface work on windows?
> Cheers,
> Rafael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161017/896b2545/attachment.html>

More information about the llvm-commits mailing list