-
Notifications
You must be signed in to change notification settings - Fork 43
Heavy heap usage on JavaScript #344
Copy link
Copy link
Open
Description
This is not really a bug with xmlutil, but there are possibly ways to mitigate the issue here.
Short version: Kotlin's CharArray.concatToString JavaScript implementation builds up strings character-by-character using +=, and KtXmlReader.text/KtXmlReader.get() calls concatToString on the buffer, resulting in an object allocated and retained for every byte in every text section.
I've opened an issue on Kotlin here: https://youtrack.jetbrains.com/issue/KT-84791/Many-string-operations-allocate-for-each-character
Per my suggestion at the bottom of that issue, I wonder if an improvement to xmlutil would be to induce string Cons compaction on JavaScript in particular immediately after the call to concatToString in KtXmlReader.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels