[PATCH] D19995: Optimize access to global variable references in PIE mode when linker supports copy relocations for PIE

H.J. Lu via llvm-commits llvm-commits at lists.llvm.org
Sun May 8 11:07:51 PDT 2016


On Sun, May 8, 2016 at 9:41 AM, Joerg Sonnenberger via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> On Sun, May 08, 2016 at 09:08:48AM -0700, H.J. Lu wrote:
>> Some Linux distros have disabled lazy binding.  I didn't notice any
>> significant startup time impact.  In fact, I only
>> discovered that lazy binding was disabled by accident on my desktop
>> machine.
>
> The impact is easily measurable, consider a simple shell loop like:
>   for x in $(seq 1 1000); do /bin/echo -n; done
>
> On my build server, that takes 0.53s. Setting LD_BIND_NOW, it takes
> 0.70s. There are work loads for which this easily translates into a
> significant chunk of the total run time.

By the same reason of performance improvement, I guess
you won't object copy relocation in PIE :-(.


-- 
H.J.


More information about the llvm-commits mailing list