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

Fix utf8 read peformance #109

Merged
merged 2 commits into from
Oct 11, 2019
Merged

Fix utf8 read peformance #109

merged 2 commits into from
Oct 11, 2019

Conversation

ahk
Copy link
Contributor

@ahk ahk commented Oct 11, 2019

Currently readUtf8 is both slow in terms of ops/s and retains excessive amounts of memory when reading long strings (long being experimentally found to be more than 12 bytes).

This PR adds a heuristic to use the built-in browser TextDecoder API in the case of these long strings, which improves ops/s and also memory retention (avoids the usage of sophisticated concatenated string data structures based on trees of pointers).

Closes #106. cc @dcervelli

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

Successfully merging this pull request may close these issues.

readUtf8 uses too much memory on V8
2 participants