diff options
| author | 2025-05-16 13:13:01 -0400 | |
|---|---|---|
| committer | 2025-05-16 13:13:01 -0400 | |
| commit | 036923515ec05b07c381448402fc256d9c564c10 (patch) | |
| tree | c3c170fb68f7504be8522acf8172977931541013 /README.md | |
| parent | Merge stranded README changes from v0.14 release (diff) | |
| download | zg-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.md | 81 |
1 files changed, 0 insertions, 81 deletions
| @@ -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 | |||
| 525 | zg is a total re-write of some of the components of Ziglyph. The idea was to | ||
| 526 | reduce binary size and improve performance. These goals were achieved by using | ||
| 527 | trie-like data structures (inspired by [Ghostty's implementation](https://mitchellh.com/writing/ghostty-devlog-006)) | ||
| 528 | instead of generated functions. Where Ziglyph uses a function call, zg uses an | ||
| 529 | array lookup, which is quite faster. In addition, all these data structures in | ||
| 530 | zg are loaded at runtime from compressed versions in the binary. This allows | ||
| 531 | for smaller binary sizes at the expense of increased memory | ||
| 532 | footprint at runtime. | ||
| 533 | |||
| 534 | Benchmarks demonstrate the above stated goals have been met: | ||
| 535 | |||
| 536 | ```plain | ||
| 537 | Binary sizes ======= | ||
| 538 | |||
| 539 | 172K ziglyph_case | ||
| 540 | 109K zg_case | ||
| 541 | |||
| 542 | 299K ziglyph_caseless | ||
| 543 | 175K zg_caseless | ||
| 544 | |||
| 545 | 91K ziglyph_codepoint | ||
| 546 | 91K zg_codepoint | ||
| 547 | |||
| 548 | 108K ziglyph_grapheme | ||
| 549 | 109K zg_grapheme | ||
| 550 | |||
| 551 | 208K ziglyph_normalizer | ||
| 552 | 175K zg_normalize | ||
| 553 | |||
| 554 | 124K ziglyph_width | ||
| 555 | 109K zg_width | ||
| 556 | |||
| 557 | Benchmarks ========== | ||
| 558 | |||
| 559 | Ziglyph toUpperStr/toLowerStr: result: 7756580, took: 74 | ||
| 560 | Ziglyph isUpperStr/isLowerStr: result: 110959, took: 17 | ||
| 561 | zg toUpperStr/toLowerStr: result: 7756580, took: 58 | ||
| 562 | zg isUpperStr/isLowerStr: result: 110959, took: 11 | ||
| 563 | |||
| 564 | Ziglyph Normalizer.eqlCaseless: result: 626, took: 479 | ||
| 565 | zg CaseFolding.canonCaselessMatch: result: 626, took: 296 | ||
| 566 | zg CaseFolding.compatCaselessMatch: result: 626, took: 604 | ||
| 567 | |||
| 568 | Ziglyph CodePointIterator: result: 3691806, took: 2.5 | ||
| 569 | zg code_point.Iterator: result: 3691806, took: 3.3 | ||
| 570 | |||
| 571 | Ziglyph GraphemeIterator: result: 3691806, took: 78 | ||
| 572 | zg Graphemes.Iterator: result: 3691806, took: 31 | ||
| 573 | |||
| 574 | Ziglyph Normalizer.nfkc: result: 3856654, took: 411 | ||
| 575 | zg Normalize.nfkc: result: 3856654, took: 208 | ||
| 576 | |||
| 577 | Ziglyph Normalizer.nfc: result: 3878290, took: 56 | ||
| 578 | zg Normalize.nfc: result: 3878290, took: 31 | ||
| 579 | |||
| 580 | Ziglyph Normalizer.nfkd: result: 3928890, took: 163 | ||
| 581 | zg Normalize.nfkd: result: 3928890, took: 101 | ||
| 582 | |||
| 583 | Ziglyph Normalizer.nfd: result: 3950526, took: 160 | ||
| 584 | zg Normalize.nfd: result: 3950526, took: 101 | ||
| 585 | |||
| 586 | Ziglyph Normalizer.eql: result: 626, took: 321 | ||
| 587 | Zg Normalize.eql: result: 626, took: 60 | ||
| 588 | |||
| 589 | Ziglyph display_width.strWidth: result: 3700914, took: 89 | ||
| 590 | zg DisplayWidth.strWidth: result: 3700914, took: 46 | ||
| 591 | ``` | ||
| 592 | |||
| 593 | These results were obtained on a MacBook Pro (2021) with M1 Pro and 16 GiB of RAM. | ||
| 594 | |||
| 595 | In contrast to Ziglyph, zg does not have: | ||
| 596 | |||
| 597 | - Word segmentation | ||
| 598 | - Sentence segmentation | ||
| 599 | - Collation | ||
| 600 | |||
| 601 | It's possible that any missing functionality will be added in future versions, | ||
| 602 | but only if enough demand is present in the community. | ||