Skip to content

Commit 1dcbcc7

Browse files
committed
doc: perf updates
1 parent 815cb6c commit 1dcbcc7

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,26 @@ See [Performance](./Performance.md) for more info
3333
import { TextDecoder, TextEncoder } from '@exodus/bytes/encoding.js'
3434
```
3535

36-
Less than half the bundle size of [text-encoding](https://npmjs.com/text-encoding), [whatwg-encoding](https://npmjs.com/whatwg-encoding) or [iconv-lite](https://npmjs.com/iconv-lite) (gzipped or not), and [is much faster](#fast).
37-
See also [lite version](#lite-version).
36+
Less than half the bundle size of [text-encoding](https://npmjs.com/text-encoding), [whatwg-encoding](https://npmjs.com/whatwg-encoding) or [iconv-lite](https://npmjs.com/iconv-lite) (gzipped or not), also [much faster](#fast).
3837

39-
Spec compliant, passing WPT and covered with extra tests.
38+
> [!TIP]
39+
> See also the [lite version](#lite-version) to get this down to 9 KiB gzipped.
4040
41-
Moreover, tests for this library uncovered [bugs in all major implementations](https://docs.google.com/spreadsheets/d/1pdEefRG6r9fZy61WHGz0TKSt8cO4ISWqlpBN5KntIvQ/edit).
42-
43-
[Faster than Node.js native implementation on Node.js](https://github.com/nodejs/node/issues/61041#issuecomment-3649242024).
41+
Spec compliant, passing WPT and covered with extra tests.\
42+
Moreover, tests for this library uncovered [bugs in all major implementations](https://docs.google.com/spreadsheets/d/1pdEefRG6r9fZy61WHGz0TKSt8cO4ISWqlpBN5KntIvQ/edit).\
43+
It works correctly even in environments that have native implementations broken (and that's all environments currently).\
4444
Runs (and passes WPT) on Node.js built without ICU.
4545

46+
> [!NOTE]
47+
> [Faster than Node.js native implementation on Node.js](https://github.com/nodejs/node/issues/61041#issuecomment-3649242024).
48+
>
49+
> The JS multi-byte version is as fast as native impl in Node.js and browsers, but (unlike them) returns correct results.
50+
>
51+
> For encodings where native version is known to be fast and correct, it is automatically used.\
52+
> Some single-byte encodings are faster than native in all three major browser engines.
53+
54+
See [analysis table](https://docs.google.com/spreadsheets/d/1pdEefRG6r9fZy61WHGz0TKSt8cO4ISWqlpBN5KntIvQ/edit) for more info.
55+
4656
### Caveat: `TextDecoder` / `TextEncoder` APIs are lossy by default per spec
4757

4858
_These are only provided as a compatibility layer, prefer hardened APIs instead in new code._

0 commit comments

Comments
 (0)