mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:18:12 +00:00
![]() 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. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
GenerateDateTimeFormatData.cpp | ||
GenerateLocaleData.cpp | ||
GenerateNumberFormatData.cpp | ||
GeneratePluralRulesData.cpp | ||
GenerateRelativeTimeFormatData.cpp |