What if instead of decoding strings, we keep reference to the original one behind a key that is arraybuffer with the bytes of the string, and compare this arraybuffer and reuse the already decoded string?
The js engine will be able to do many cool things with it.
But it can memory leak, and add memory overhead.
How can we known when we can remove the decoded string from the cache?
How can we lookup inside the cache?
What if instead of decoding strings, we keep reference to the original one behind a key that is arraybuffer with the bytes of the string, and compare this arraybuffer and reuse the already decoded string? The js engine will be able to do many cool things with it. But it can memory leak, and add memory overhead. How can we known when we can remove the decoded string from the cache? How can we lookup inside the cache?
Worth researching!