Commit Graph

14 Commits

Author SHA1 Message Date
Moritz Bunkus
39529c226b
languages/scripts/regions/IANA lists: use different method of initialization
The prior method was to generate one line of
`g_container.emplace_back(…)` per entry in the list & letting the
compiler chew on that. Each string argument in that call was done was
`u8"Some Name"s`, meaning as a std::string instance.

Drawbacks:

• takes the compiler ages to compile, even forcing me to drop all
  optimizations for the ISO-639 language list file

• even smaller files such as the IANA language subtag registry lists
  take more than 30s to compile

• due to no optimizations initialization is actually not as fast as
  could be

The new method uses a plain C-style array of structs with `char
const *` entries for the initial list. The initialization method then
copies the entries from that list to the actual container, again using
`std::emplace_back(…)`.

This yields sub-1s compilation times even with the longest file, the
ISO-639 language list, and the runtime initialization is actually
faster.
2022-04-23 00:00:15 +02:00
Moritz Bunkus
65752aedcc
BCP47: regions: include fact whether entries are deprecated
Part of the implementation of #3307.
2022-03-26 13:40:09 +01:00
Moritz Bunkus
92ef8628f2
BCP47: add regions present in IANA registry but not part of ISO 3166/UN M.49
Part of the implementation of #3307.
2022-03-26 13:40:09 +01:00
Moritz Bunkus
d2e0222418
ISO 3166: remove unused variable 2021-07-19 14:15:03 +02:00
Moritz Bunkus
5a353eba99
ISO 3166: update list of countries & regions from lists on the internet 2021-07-17 13:51:17 +02:00
Moritz Bunkus
f690be057b
build system: move HTML table data extraction to separate function 2021-07-17 13:51:17 +02:00
Moritz Bunkus
fb7ff32d3d
BCP 47: support for "user-defined" country codes AA, QM–QZ, XA–XZ, ZZ 2021-07-11 11:22:41 +02:00
Moritz Bunkus
5d04e5bfd5
BCP 47: use emplace_back for initialization of ISO 3166 region list
It's much faster than using the initializer lists. See previous commits
for more details.
2021-01-26 14:53:31 +01:00
Moritz Bunkus
ed309582ce
BCP 47: various lists: cosmetics (remove superfluous space at end of row) 2021-01-26 14:53:30 +01:00
Moritz Bunkus
2156af77fa
Rakefile: add dev target for updating all lists 2020-09-07 17:49:33 +02:00
Moritz Bunkus
1decaad545
BCP 47 language_c: support for UN M.49 region codes without ISO 3166 alpha codes
Part of the implementation of #2919.
2020-09-07 17:49:32 +02:00
Moritz Bunkus
4fd4d56374
ISO 3166: rename from countries to regions
Preparation for adding UN M.49 regions that don't have an ISO 3166-1
country code.

Part of the implementation of #2919.
2020-09-07 17:49:32 +02:00
Moritz Bunkus
d5dbdb0a7e
replace outdated link to GPLv2 with current one 2020-08-01 18:03:54 +02:00
Moritz Bunkus
c8742e80d3
Rakefile: add target for generating list of ISO 3166 countries 2020-07-02 19:09:47 +02:00