Skip to content

Commit 9f4a05f

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

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,24 @@ 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) for a 9 KiB gzipped polyfill.
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+
> The JS multi-byte version is as fast as native impl in Node.js and browsers, but (unlike them) returns correct results.\
49+
> For encodings where native version is known to be fast and correct, it is automatically used.\
50+
> Some single-byte encodings are (somewhy) faster than native in all three major browser engines.
51+
52+
See [analysis table](https://docs.google.com/spreadsheets/d/1pdEefRG6r9fZy61WHGz0TKSt8cO4ISWqlpBN5KntIvQ/edit) for more info.
53+
4654
### Caveat: `TextDecoder` / `TextEncoder` APIs are lossy by default per spec
4755

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

0 commit comments

Comments
 (0)