summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGravatar Sam Atman2025-05-16 13:13:01 -0400
committerGravatar Sam Atman2025-05-16 13:13:01 -0400
commit036923515ec05b07c381448402fc256d9c564c10 (patch)
treec3c170fb68f7504be8522acf8172977931541013 /README.md
parentMerge stranded README changes from v0.14 release (diff)
downloadzg-036923515ec05b07c381448402fc256d9c564c10.tar.gz
zg-036923515ec05b07c381448402fc256d9c564c10.tar.xz
zg-036923515ec05b07c381448402fc256d9c564c10.zip
Remove benchmarks, ziglyph references
`ziglyph` is no longer maintained and basically abandoned, there's no need to keep the comparison between them active going forward.
Diffstat (limited to 'README.md')
-rw-r--r--README.md81
1 files changed, 0 insertions, 81 deletions
diff --git a/README.md b/README.md
index bfa8d5e..1d3899c 100644
--- a/README.md
+++ b/README.md
@@ -519,84 +519,3 @@ test "Scripts" {
519 try expect(scripts.script('צ') == .Hebrew); 519 try expect(scripts.script('צ') == .Hebrew);
520} 520}
521``` 521```
522
523## Relation to Ziglyph
524
525zg is a total re-write of some of the components of Ziglyph. The idea was to
526reduce binary size and improve performance. These goals were achieved by using
527trie-like data structures (inspired by [Ghostty's implementation](https://mitchellh.com/writing/ghostty-devlog-006))
528instead of generated functions. Where Ziglyph uses a function call, zg uses an
529array lookup, which is quite faster. In addition, all these data structures in
530zg are loaded at runtime from compressed versions in the binary. This allows
531for smaller binary sizes at the expense of increased memory
532footprint at runtime.
533
534Benchmarks demonstrate the above stated goals have been met:
535
536```plain
537Binary sizes =======
538
539172K ziglyph_case
540109K zg_case
541
542299K ziglyph_caseless
543175K zg_caseless
544
54591K ziglyph_codepoint
54691K zg_codepoint
547
548108K ziglyph_grapheme
549109K zg_grapheme
550
551208K ziglyph_normalizer
552175K zg_normalize
553
554124K ziglyph_width
555109K zg_width
556
557Benchmarks ==========
558
559Ziglyph toUpperStr/toLowerStr: result: 7756580, took: 74
560Ziglyph isUpperStr/isLowerStr: result: 110959, took: 17
561zg toUpperStr/toLowerStr: result: 7756580, took: 58
562zg isUpperStr/isLowerStr: result: 110959, took: 11
563
564Ziglyph Normalizer.eqlCaseless: result: 626, took: 479
565zg CaseFolding.canonCaselessMatch: result: 626, took: 296
566zg CaseFolding.compatCaselessMatch: result: 626, took: 604
567
568Ziglyph CodePointIterator: result: 3691806, took: 2.5
569zg code_point.Iterator: result: 3691806, took: 3.3
570
571Ziglyph GraphemeIterator: result: 3691806, took: 78
572zg Graphemes.Iterator: result: 3691806, took: 31
573
574Ziglyph Normalizer.nfkc: result: 3856654, took: 411
575zg Normalize.nfkc: result: 3856654, took: 208
576
577Ziglyph Normalizer.nfc: result: 3878290, took: 56
578zg Normalize.nfc: result: 3878290, took: 31
579
580Ziglyph Normalizer.nfkd: result: 3928890, took: 163
581zg Normalize.nfkd: result: 3928890, took: 101
582
583Ziglyph Normalizer.nfd: result: 3950526, took: 160
584zg Normalize.nfd: result: 3950526, took: 101
585
586Ziglyph Normalizer.eql: result: 626, took: 321
587Zg Normalize.eql: result: 626, took: 60
588
589Ziglyph display_width.strWidth: result: 3700914, took: 89
590zg DisplayWidth.strWidth: result: 3700914, took: 46
591```
592
593These results were obtained on a MacBook Pro (2021) with M1 Pro and 16 GiB of RAM.
594
595In contrast to Ziglyph, zg does not have:
596
597- Word segmentation
598- Sentence segmentation
599- Collation
600
601It's possible that any missing functionality will be added in future versions,
602but only if enough demand is present in the community.