String.codeUnitAt on a const _OneByteString is much slower on dart2wasm than on every other Dart backend, and ~10x slower than indexing an equivalent Uint8List on dart2wasm itself.
Benchmark: sum _LUT[a[i]] best of 5 rounds in microseconds.
|
JIT |
AOT |
dart2js |
dart2wasm |
const String + codeUnitAt |
50 k |
43 k |
73 k |
786 k |
hoisted Uint8List |
61 k |
61 k |
105 k |
66 k |
Full repro: https://gist.github.com/modulovalue/7c4bed1762166a6e776265d0fc9abde3
String.codeUnitAton a const_OneByteStringis much slower on dart2wasm than on every other Dart backend, and ~10x slower than indexing an equivalentUint8Liston dart2wasm itself.Benchmark: sum
_LUT[a[i]]best of 5 rounds in microseconds.codeUnitAtUint8ListFull repro: https://gist.github.com/modulovalue/7c4bed1762166a6e776265d0fc9abde3