Bnaya / objectbuffer

JavaScript Object like api, backed by an arraybuffer
MIT License
171 stars 5 forks source link

External values cache/map #103

Open Bnaya opened 4 years ago

Bnaya commented 4 years ago

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!