This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Mmap and performance of gold
Mikolaj Zalewski <mikolajz@google.com> writes:
> 64-bit build -O2:
> Mmapping all files:
> real 0m3.640s
> user 0m2.884s
> sys 0m0.716s
>
> Mmaping selected regions:
> real 0m5.318s
> user 0m2.984s
> sys 0m2.312s
>
> 32-bit build -O2:
> Mmapping all files:
> real 0m3.787s
> user 0m3.120s
> sys 0m0.608s
>
> Mmaping selected regions:
> real 0m5.422s
> user 0m3.124s
> sys 0m2.240s
Those results are certainly compelling. Thanks for trying this.
As you know, we can't mmap entire files on a 32-bit host: in a large
link, we will run out of address space. However, we clearly should mmap
entire files on a 64-bit host. Your suggestion of a command line option
with different defaults makes sense.
We do have to worry about alignment, though, so that archives work
correctly on processors which do not permit misaligned accesses. Even
on x86 it will make some difference, as misaligned accesses are slower.
This just means that in some cases we will have to memcpy the data from
the mapped memory into an aligned buffer.
Ian