This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Performance of global access versus thread local


If you're going to use a DSO like that, you should use LD_BIND_NOW=1 to
keep startup overhead out of your measured loops.  There is no real need to
use a DSO though.  I'm guessing you did so just to make sure the tested
accesses were the PIC flavors.  You can just compile the main program with
-fPIC for that.

For the global case, it would be a hidden global within libc itself.
So you need the  __attribute__ ((visibility ("hidden"))) variant to
be representative of what the accesses inside libc would do.

It's probably better to write the two accesses by hand in assembly--or at
least show us the disassembly of what you compiled--to be sure they are
really representative of what the special-case assembly access in libc
would do.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]