unicode

Branch: main

Switch branches or tags

Branch: main
Go to file t

413 files indexed

History
Code

normalization/decomposition_bench_test.mbt
1///|2/// Keep input construction outside the timed closures. Run with:3/// moon bench normalization --target native --release4/// (also --target wasm and --target wasm-gc).5test "decomposition" (b : @bench.T) {6  for7    (name, input) in [8      ("accented Latin", "Ünïcödé Çàfé Dragiša Đorđević ".repeat(64)),9      ("Vietnamese", "Việt Nam ngữ pháp tiếng Việt ".repeat(64)),10      ("dense precomposed", "éèêëàâîïôûç".repeat(128)),11      ("compatibility characters", "ffi①½ア㍿".repeat(128)),12      ("Hangul syllables", "한국어 정규화 ".repeat(128)),13      ("unchanged CJK", "中文日本語".repeat(256)),14    ] {15    for form in [@normalization.NFD, @normalization.NFKD] {16      b.bench(name="\{form}/\{name}", fn() {17        b.keep(@normalization.normalize(input, form))18      })19    }20  }21}22