unicode

Branch: main

Switch branches or tags

Branch: main
Go to file t

413 files indexed

History
Code

bench/punctsize/README.md

Punctuation artifact size

Compare the compiled package units behind the two ways to test punctuation:

@unicode.is_punctuation(c)
@unicode.general_category(c).group() is @unicode.GeneralCategoryGroup::P

Build the two low-level packages at release:

moon build --target wasm-gc --release ucd/punctuation
moon build --target wasm-gc --release ucd/general_category

Then compare their .core package artifacts:

wc -c \
  _build/wasm-gc/release/build/moonbit-community/unicode-data/punctuation/punctuation.core \
  _build/wasm-gc/release/build/moonbit-community/unicode-data/general_category/general_category.core

Example wasm-gc release sizes:

Package .core bytes
punctuation 3,731
general_category 44,223

The .core file is the compiled package artifact that the linker pulls in when the predicate is used; it contains the lookup function and its table. Measuring it needs no executable probe and no artificial result consumer. The difference is the General_Category trie, which the punctuation package does not link.

1# Punctuation artifact size23Compare the compiled package units behind the two ways to test punctuation:45```moonbit6@unicode.is_punctuation(c)7@unicode.general_category(c).group() is @unicode.GeneralCategoryGroup::P8```910Build the two low-level packages at release:1112```sh13moon build --target wasm-gc --release ucd/punctuation14moon build --target wasm-gc --release ucd/general_category15```1617Then compare their `.core` package artifacts:1819```sh20wc -c \21  _build/wasm-gc/release/build/moonbit-community/unicode-data/punctuation/punctuation.core \22  _build/wasm-gc/release/build/moonbit-community/unicode-data/general_category/general_category.core23```2425Example `wasm-gc` release sizes:2627| Package | `.core` bytes |28| --- | ---: |29| `punctuation` | 3,731 |30| `general_category` | 44,223 |3132The `.core` file is the compiled package artifact that the linker pulls in when33the predicate is used; it contains the lookup function and its table. Measuring34it needs no executable probe and no artificial result consumer. The difference35is the General_Category trie, which the punctuation package does not link.36