1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 22:44:58 +00:00
serenity/Userland/Libraries/LibUnicode/CodeGenerators
Timothy Flynn 7dce2bfe23 LibUnicode: Generate separate tables for General Category properties
Previously, each code point's General Category was part of the generated
UnicodeData structure. This ultimately presented two problems, one
functional and one performance related:

  * Some General Categories are applied to unassigned code points, for
    example the Unassigned (Cn) category. Unassigned code points are
    strictly excluded from UnicodeData.txt, so by relying on that file,
    the generator is unable to handle these categories.

  * Lookups for General Categories are slower when searching through the
    large UnicodeData hash map. Even though lookups are O(1), the hash
    function turned out to be slower than binary searching through a
    category-specific table.

So, now a table is generated for each General Category. When querying a
code point for a category, a binary search is done on each code point
range in that category's table to check if code point has that category.

Further, General Categories are now parsed from the UCD file
DerivedGeneralCategory.txt. This file is a normal "prop list" file and
contains the categories for unassigned code points.
2021-08-11 13:11:01 +02:00
..
CMakeLists.txt LibUnicode: Introduce a Unicode library for interacting with UCD files 2021-07-26 17:03:55 +01:00
GenerateUnicodeData.cpp LibUnicode: Generate separate tables for General Category properties 2021-08-11 13:11:01 +02:00