This is the mail archive of the libc-alpha@sources.redhat.com 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]

RFC: locale-archive optimizing for the primary locale


Hi!

I wonder whether we shouldn't optimize locale reading for the primary
system locale as IMHO most users just stick to one locale and don't change
it either at all or in the common case.
I don't think there needs to be any special options for this, just that
the first locale added to the archive when it was empty would be
considered the primary one.
localedef would have to be changed to keep relative order of locales
during expand_archive (ATM it just picks the locales as they go in the
hash table) - a simple sort based on smallest file_offset
(and other offsets if the smallest is equal) should do the job.

The first locale has the advantage that not just the small locale files,
but all of them are in one contiguous chunk, so reading it takes 2 mmaps
(and if we wanted to optimize for this case even more, we could either
hardcode some minimal length of the mmap call where the hash tables/string
table is mmaped, say 2MB, or add a field to the locale-archive file header
which would be the smallest size covering hash tables and the first
locale, or we could add add to the locale-archive file header that size
plus the name of the first locale as string, so that loadlocale could
compare this when doing read from the archive and decide whether to
do a bigger mmap or smallerone).

What do you think?

	Jakub


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