Closed
Description
Currently a loader use String.fromCharCode
for decoding a text from wasm-memory to JS-string.
I created test that compare current implementation with TextDecoder.
For popular browser (Safari, Chrome, Firefox) it faster that String.fromCharCode
For Safari on iOS14 TextDecoder is extrimely faster (about 10 times).
Test
https://esbench.com/bench/5f6c9945b4632100a7dcd322
Results
Left - FF (Latest), Right - Chrome (Latest)
UPD:
For strings lequal 30 chars String.fromCharCode
runs faster that TextDecoder
in Chrome, for FF and Safari on my devices this does not apply.