summaryrefslogtreecommitdiff
path: root/src/code_point.zig
diff options
context:
space:
mode:
authorGravatar Ryan Liptak2024-06-27 02:33:06 -0700
committerGravatar Ryan Liptak2024-06-27 02:33:51 -0700
commitbd7c0cf2998b626879e147e4cec2b30f71015631 (patch)
tree9c6a3a96ebd31d960fd4e5312f11ab0fb5470a74 /src/code_point.zig
parentImplements new case fold data encoding by @sqeek502 #8 (diff)
downloadzg-bd7c0cf2998b626879e147e4cec2b30f71015631.tar.gz
zg-bd7c0cf2998b626879e147e4cec2b30f71015631.tar.xz
zg-bd7c0cf2998b626879e147e4cec2b30f71015631.zip
FoldData: Minimize Changes_When_Casefolded data
Only a few codepoints have a mapping in CaseFolding.txt but do not have the Changes_When_Casefolded property set. So, FoldData can just store a list of those particular codepoints and then re-use the encoded CaseFolding.txt data alongside it in order to implement changesWhenCaseFolded. This reduces the size of fold.bin.z from 4,387 bytes (4.28KiB) to 1,165 bytes (1.13KiB). This also seemingly introduced a very slight performance regression in zg_caseless. Before: zg CaseFold.compatCaselessMatch: result: 626, took: 258ns zg CaseFold.canonCaselessMatch: result: 626, took: 129ns After: zg CaseFold.compatCaselessMatch: result: 626, took: 263ns zg CaseFold.canonCaselessMatch: result: 626, took: 131ns
Diffstat (limited to 'src/code_point.zig')
0 files changed, 0 insertions, 0 deletions