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: [PATCH] time: Avoid alignment gaps in __tzfile_read


Florian Weimer wrote:
This is a long-term allocation, and
the reading of the file happens only once per allocation, so I do think
that the additional __fread_unlocked call is not a problem from a
performance perspective.

The upstream code uses a single 'read' call, bypassing stdio entirely. It doesn't even stat the file; all it does is 'access' (if a relative filename, for security reasons), 'open', 'read', 'close'. I wonder why glibc went to stdio for this? Seems overkill. In practice, I'd think going back to syscalls would gain more performance than any of the stuff we've talked about so far.

Anyway - if we're moving things around, how about putting 'leaps' before 'transitions' instead of after? This will eliminate alignment gaps just as well in practice, and it will allow us to do one fread instead of two.

PS. While you're in the neighborhood, the leap second correction field (struct leap.change) can be 'int' instead of 'long int', as the TZif format allows only 32 bits of (signed) correction.


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