Skip to content

text-encoding v1.0.0

Choose a tag to compare

@ammarahm-ed ammarahm-ed released this 03 Sep 08:54
· 153 commits to main since this release

TextEncoder and TextDecoder for
@react-native-quickjs/quickjs,
per WHATWG Encoding.

npm install @react-native-quickjs/text-encoding

The runtime depends on this package, so an app on QuickJS has both globals
already.

Against the JavaScript polyfill, same runtime, same inputs:

case native polyfill speedup
encode 15 B ascii 127 ns 1472 ns 11.6×
encode 4 KB ascii 4578 ns 294922 ns 64.4×
encode 1.2 KB mixed 782 ns 77148 ns 98.7×
decode 15 B ascii 46 ns 1045 ns 22.7×
decode 4 KB ascii 1190 ns 433594 ns 364.3×
decode 1.2 KB mixed 1976 ns 93750 ns 47.4×