1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:18:12 +00:00
serenity/Meta/Lagom/Tools/CodeGenerators/LibLocale
Timothy Flynn bbd80d2e4d LibLocale: Replace some slow CLDR vector lookups with a hash map
The LocaleData generator currently stores vectors of unique instances of
CLDR data (e.g. languages, currencies, etc.). For each CLDR file that we
parse, we linearly search through those vectors to decide if the current
field being parsed is unique. Given the size of the CLDR, this adds up
to quite a bit of time.

Augment these vectors with a hash map to store the index of each unique
instance in those vectors. This allows for quickly checking if a field
is unique, and to later look up those indices.

We do not apply this technique to every bit of CLDR data here. For
example, CLDR::character_orders contains only 2 entries. In that case,
it is quicker to search the vector than it is to hash a string key.

This reduces the runtime of GenerateLocaleData from to 2.03s to 1.09s.
2023-07-28 21:05:52 +02:00
..
CMakeLists.txt LibUnicode: Move CLDR data generators to a LibLocale subfolder 2022-09-05 14:37:16 -04:00
GenerateDateTimeFormatData.cpp AK: Add the Input word to input-only buffered streams 2023-05-09 11:18:46 +02:00
GenerateLocaleData.cpp LibLocale: Replace some slow CLDR vector lookups with a hash map 2023-07-28 21:05:52 +02:00
GenerateNumberFormatData.cpp AK: Add the Input word to input-only buffered streams 2023-05-09 11:18:46 +02:00
GeneratePluralRulesData.cpp LibLocale: Avoid unnecessary HashMap copy 2023-05-19 22:33:57 +02:00
GenerateRelativeTimeFormatData.cpp AK: Add the Input word to input-only buffered streams 2023-05-09 11:18:46 +02:00