Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text Decoding #1470

Closed
eXponenta opened this issue Sep 24, 2020 · 1 comment · Fixed by #1471
Closed

Text Decoding #1470

eXponenta opened this issue Sep 24, 2020 · 1 comment · Fixed by #1471

Comments

@eXponenta
Copy link

eXponenta commented Sep 24, 2020

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
image
Left - FF (Latest), Right - Chrome (Latest)

image
IOS 14 Safari Ipda 2018

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.

@github-actions
Copy link

🎉 This issue has been resolved in version 0.14.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants