Skip to content

Commit 6435534

Browse files
committed
report Zstandard compression results
1 parent 5bda67c commit 6435534

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ Since [Hermes doesn't support the `Intl.Segmenter` API](https://github.com/faceb
254254

255255
#### JS Bundle Stats
256256

257-
| Name | Unicode® | ESM? | Size | Size (min) | Size (min+gzip) | Size (min+br) |
258-
|------------------------------|----------|------|----------:|-----------:|----------------:|--------------:|
259-
| `unicode-segmenter/grapheme` | 16.0.0 | ✔️ | 15,941 | 12,192 | 5,064 | 3,739 |
260-
| `graphemer` | 15.0.0 | ✖️ ️| 410,435 | 95,104 | 15,752 | 10,660 |
261-
| `grapheme-splitter` | 10.0.0 | ✖️ | 122,252 | 23,680 | 7,852 | 4,841 |
262-
| `@formatjs/intl-segmenter`* | 15.0.0 | ✖️ | 603,285 | 369,560 | 72,218 | 49,416 |
263-
| `unicode-segmentation`* | 16.0.0 | ✔️ | 56,529 | 52,443 | 24,110 | 17,343 |
264-
| `Intl.Segmenter`* | - | - | 0 | 0 | 0 | 0 |
257+
| Name | Unicode® | ESM? | Size | Size (min) | Size (min+gzip) | Size (min+br) | Size (min+zstd) |
258+
|------------------------------|----------|------|----------:|-----------:|----------------:|--------------:|----------------:|
259+
| `unicode-segmenter/grapheme` | 16.0.0 | ✔️ | 15,941 | 12,192 | 5,064 | 3,739 | 4,747 |
260+
| `graphemer` | 15.0.0 | ✖️ ️| 410,435 | 95,104 | 15,752 | 10,660 | 15,911 |
261+
| `grapheme-splitter` | 10.0.0 | ✖️ | 122,252 | 23,680 | 7,852 | 4,841 | 6,750 |
262+
| `@formatjs/intl-segmenter`* | 15.0.0 | ✖️ | 603,285 | 369,560 | 72,218 | 49,416 | 67,975 |
263+
| `unicode-segmentation`* | 16.0.0 | ✔️ | 56,529 | 52,443 | 24,110 | 17,343 | 24,377 |
264+
| `Intl.Segmenter`* | - | - | 0 | 0 | 0 | 0 | 0 |
265265

266266
* `@formatjs/intl-segmenter` handles grapheme, word, and sentence, but it's not tree-shakable.
267267
* `unicode-segmentation` size contains only minimum WASM binary and its bindings to execute benchmarking. It will increases to expose more features.

benchmark/_helper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { promisify } from 'node:util';
33

44
let gzip = promisify(zlib.gzip);
55
let brotli = promisify(zlib.brotliCompress);
6+
let zstd = promisify(zlib.zstdCompress);
67

78
function byteLength(bytes, pretty = process.env.PRETTY === 'true') {
89
let len = bytes;
@@ -19,6 +20,7 @@ export async function reportBundleStats(name, bundle, minBundle) {
1920
'Size (min)': byteLength(minBundle),
2021
'Size (min+gzip)': byteLength(await gzip(minBundle)),
2122
'Size (min+br)': byteLength(await brotli(minBundle)),
23+
'Size (min+zstd)': byteLength(await zstd(minBundle)),
2224
};
2325
}
2426

@@ -29,6 +31,7 @@ export async function reportWasmBindingStats(name, bundle, minBundle, wasm) {
2931
'Size (min)': byteLength(minBundle.byteLength + wasm.byteLength),
3032
'Size (min+gzip)': byteLength((await gzip(minBundle)).byteLength + (await gzip(wasm)).byteLength),
3133
'Size (min+br)': byteLength((await brotli(minBundle)).byteLength + (await brotli(wasm)).byteLength),
34+
'Size (min+zstd)': byteLength((await zstd(minBundle)).byteLength + (await zstd(wasm)).byteLength),
3235
};
3336
}
3437

0 commit comments

Comments
 (0)