Skip to content

Commit 8e049b4

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

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,30 @@ 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).\
37+
Also [much faster](#fast) than all of those.
3838

39-
Spec compliant, passing WPT and covered with extra tests.
39+
> [!TIP]
40+
> See also the [lite version](#lite-version) to get this down to 9 KiB gzipped.
4041
41-
Moreover, tests for this library uncovered [bugs in all major implementations](https://docs.google.com/spreadsheets/d/1pdEefRG6r9fZy61WHGz0TKSt8cO4ISWqlpBN5KntIvQ/edit).
42+
Spec compliant, passing WPT and covered with extra tests.\
43+
Moreover, tests for this library uncovered [bugs in all major implementations](https://docs.google.com/spreadsheets/d/1pdEefRG6r9fZy61WHGz0TKSt8cO4ISWqlpBN5KntIvQ/edit).\
44+
Including all three major browser engines being wrong at UTF-8.
45+
See [WPT pull request](https://github.com/web-platform-tests/wpt/pull/56892).
4246

43-
[Faster than Node.js native implementation on Node.js](https://github.com/nodejs/node/issues/61041#issuecomment-3649242024).
47+
It works correctly even in environments that have native implementations broken (that's all of them currently).\
4448
Runs (and passes WPT) on Node.js built without ICU.
4549

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

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

0 commit comments

Comments
 (0)