[PATCH 2/4] time: Push tzset lock into callers of time functions

Paul Eggert eggert@cs.ucla.edu
Tue Oct 1 17:51:17 GMT 2024


On 2024-10-01 10:37, Alexander Monakov wrote:
> On the flip side, in PIC for libc.so this needs a PC-relative computation,
> which is not as cheap as amd64's rip-relative lea everywhere.

Good point. For what it's worth, on x86-64, gcc -fPIC -O2 generates a 
conditional branch no matter which way you code it, but the code quality 
is worse in the more-elegant formulation.

For Gnulib (which typically doesn't use -fPIC) the more-elegant version 
is a performance win; for glibc not so much. I wouldn't favor an "#if 
_LIBC" here, so it's just an elegance-vs-performance issue and it'd be 
fine to ignore my suggestion.


More information about the Libc-alpha mailing list