Skip to content

Commit

Permalink
clear entry name
Browse files Browse the repository at this point in the history
  • Loading branch information
cometkim committed Jun 13, 2024
1 parent 56b3b74 commit 9d4a436
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,15 @@ The gap may increase depending on the environment. Bindings for browsers general
----------------------------------------------------------------------------------- -----------------------------
• Lorem ipsum (ascii)
----------------------------------------------------------------------------------- -----------------------------
unicode-segmenter 5'668 ns/iter (5'332 ns … 6'582 ns) 5'778 ns 6'326 ns 6'582 ns
unicode-segmenter/grapheme 5'668 ns/iter (5'332 ns … 6'582 ns) 5'778 ns 6'326 ns 6'582 ns
Intl.Segmenter 51'811 ns/iter (47'208 ns … 524 µs) 51'917 ns 61'708 ns 436 µs
graphemer 49'103 ns/iter (46'583 ns … 280 µs) 48'625 ns 101 µs 182 µs
grapheme-splitter 123 µs/iter (117 µs … 1'066 µs) 122 µs 171 µs 816 µs
unicode-rs/unicode-segmentation (wasm-pack) 16'935 ns/iter (15'542 ns … 274 µs) 16'542 ns 30'084 ns 130 µs
@formatjs/intl-segmenter 42'689 ns/iter (38'792 ns … 941 µs) 41'875 ns 106 µs 216 µs
summary for Lorem ipsum (ascii)
unicode-segmenter
unicode-segmenter/grapheme
2.99x faster than unicode-rs/unicode-segmentation (wasm-pack)
7.53x faster than @formatjs/intl-segmenter
8.66x faster than graphemer
Expand All @@ -384,15 +384,15 @@ The gap may increase depending on the environment. Bindings for browsers general
• Emojis
----------------------------------------------------------------------------------- -----------------------------
unicode-segmenter 1'717 ns/iter (1'656 ns … 1'941 ns) 1'727 ns 1'939 ns 1'941 ns
unicode-segmenter/grapheme 1'717 ns/iter (1'656 ns … 1'941 ns) 1'727 ns 1'939 ns 1'941 ns
Intl.Segmenter 14'715 ns/iter (12'334 ns … 1'301 µs) 13'792 ns 20'000 ns 820 µs
graphemer 13'752 ns/iter (12'625 ns … 1'385 µs) 13'583 ns 22'875 ns 136 µs
grapheme-splitter 27'406 ns/iter (26'625 ns … 427 µs) 26'958 ns 32'333 ns 69'042 ns
unicode-rs/unicode-segmentation (wasm-pack) 5'728 ns/iter (5'497 ns … 12'383 ns) 5'711 ns 6'953 ns 12'383 ns
@formatjs/intl-segmenter 14'579 ns/iter (13'541 ns … 377 µs) 14'541 ns 19'583 ns 166 µs
summary for Emojis
unicode-segmenter
unicode-segmenter/grapheme
3.34x faster than unicode-rs/unicode-segmentation (wasm-pack)
8.01x faster than graphemer
8.49x faster than @formatjs/intl-segmenter
Expand All @@ -401,15 +401,15 @@ The gap may increase depending on the environment. Bindings for browsers general
• Demonic characters
----------------------------------------------------------------------------------- -----------------------------
unicode-segmenter 1'699 ns/iter (1'636 ns … 1'986 ns) 1'719 ns 1'891 ns 1'986 ns
unicode-segmenter/grapheme 1'699 ns/iter (1'636 ns … 1'986 ns) 1'719 ns 1'891 ns 1'986 ns
Intl.Segmenter 5'088 ns/iter (3'501 ns … 9'109 ns) 7'867 ns 9'083 ns 9'109 ns
graphemer 27'386 ns/iter (26'333 ns … 332 µs) 26'958 ns 30'333 ns 161 µs
grapheme-splitter 19'959 ns/iter (18'958 ns … 380 µs) 19'500 ns 24'333 ns 247 µs
unicode-rs/unicode-segmentation (wasm-pack) 2'518 ns/iter (2'444 ns … 4'894 ns) 2'534 ns 2'839 ns 4'894 ns
@formatjs/intl-segmenter 17'272 ns/iter (16'708 ns … 231 µs) 17'375 ns 18'541 ns 39'000 ns
summary for Demonic characters
unicode-segmenter
unicode-segmenter/grapheme
1.48x faster than unicode-rs/unicode-segmentation (wasm-pack)
2.99x faster than Intl.Segmenter
10.16x faster than @formatjs/intl-segmenter
Expand All @@ -418,15 +418,15 @@ The gap may increase depending on the environment. Bindings for browsers general
• Tweet text (combined)
----------------------------------------------------------------------------------- -----------------------------
unicode-segmenter 8'025 ns/iter (7'867 ns … 8'619 ns) 8'168 ns 8'614 ns 8'619 ns
unicode-segmenter/grapheme 8'025 ns/iter (7'867 ns … 8'619 ns) 8'168 ns 8'614 ns 8'619 ns
Intl.Segmenter 70'021 ns/iter (63'667 ns … 562 µs) 69'875 ns 79'458 ns 519 µs
graphemer 69'922 ns/iter (66'583 ns … 320 µs) 69'708 ns 92'875 ns 271 µs
grapheme-splitter 152 µs/iter (147 µs … 467 µs) 153 µs 165 µs 429 µs
unicode-rs/unicode-segmentation (wasm-pack) 24'428 ns/iter (23'583 ns … 302 µs) 24'084 ns 27'334 ns 157 µs
@formatjs/intl-segmenter 64'112 ns/iter (61'333 ns … 338 µs) 63'083 ns 88'625 ns 272 µs
summary for Tweet text (combined)
unicode-segmenter
unicode-segmenter/grapheme
3.04x faster than unicode-rs/unicode-segmentation (wasm-pack)
7.99x faster than @formatjs/intl-segmenter
8.71x faster than graphemer
Expand All @@ -435,15 +435,15 @@ The gap may increase depending on the environment. Bindings for browsers general
• Code snippet (combined)
----------------------------------------------------------------------------------- -----------------------------
unicode-segmenter 19'661 ns/iter (18'125 ns … 350 µs) 19'458 ns 24'708 ns 185 µs
unicode-segmenter/grapheme 19'661 ns/iter (18'125 ns … 350 µs) 19'458 ns 24'708 ns 185 µs
Intl.Segmenter 158 µs/iter (148 µs … 443 µs) 158 µs 323 µs 428 µs
graphemer 163 µs/iter (159 µs … 401 µs) 161 µs 284 µs 390 µs
grapheme-splitter 350 µs/iter (343 µs … 712 µs) 348 µs 424 µs 705 µs
unicode-rs/unicode-segmentation (wasm-pack) 57'376 ns/iter (55'917 ns … 300 µs) 56'667 ns 67'959 ns 209 µs
@formatjs/intl-segmenter 150 µs/iter (142 µs … 579 µs) 150 µs 310 µs 475 µs
summary for Code snippet (combined)
unicode-segmenter
unicode-segmenter/grapheme
2.92x faster than unicode-rs/unicode-segmentation (wasm-pack)
7.65x faster than @formatjs/intl-segmenter
8.03x faster than Intl.Segmenter
Expand Down
4 changes: 2 additions & 2 deletions benchmark/performance-grapheme.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as assert from 'node:assert/strict';
import { group, bench, run } from 'mitata';
import { group, baseline, bench, run } from 'mitata';

import Graphemer from 'graphemer';
import GraphemeSplitter from 'grapheme-splitter';
Expand Down Expand Up @@ -65,7 +65,7 @@ for (const [title, input] of testcases) {
assert.deepEqual([...formatjsSegmenter.segment(input)].map(({ segment }) => segment), expected);

group(title, () => {
bench('unicode-segmenter', () => {
baseline('unicode-segmenter/grapheme', () => {
void ([...graphemeSegments(input)]);
});

Expand Down

0 comments on commit 9d4a436

Please sign in to comment.