Skip to content

Fix utf8 read peformance - #109

Merged
mourner merged 2 commits into
masterfrom
fix-utf8-read-peformance
Oct 11, 2019
Merged

mourner merged 2 commits into
masterfrom
fix-utf8-read-peformance

Conversation

@ahk

@ahk ahk commented Oct 11, 2019

Copy link
Copy Markdown
Contributor

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

@ahk
ahk force-pushed the fix-utf8-read-peformance branch from 30862a3 to 21bbaf2 Compare October 11, 2019 13:35
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