anonyco / FastestSmallestTextEncoderDecoder

The fastest smallest Javascript polyfill for encodeInto of TextEncoder, encode of TextEncoder, and decode of TextDecoder for UTF-8 only.
https://anonyco.github.io/FastestSmallestTextEncoderDecoder/gh-pages/
Creative Commons Zero v1.0 Universal
145 stars 33 forks source link

v8/js engine string cache use age #13

Open Bnaya opened 4 years ago

Bnaya commented 4 years ago

Hey Jack!

Thank you again for this amazing library! I'n using parts of the code in https://github.com/Bnaya/objectbuffer

V8 and other js engines are trying to deduplicate strings references, and also hold strings as rope data structure. In my use-case, i'm doing many decoding of the same string over and over again, and i'm not sure how to actual memory in the js engine side gonna end up.

I was wondering if you made any analysis regarding that topic and if you cloud share some findings

Thanks! Bnaya

anonyco commented 4 years ago

You raise a good point about a valid concern. I am also interested in knowing how well this library handles strings. However, I do not know how to make an analysis of such data. I'm not that deep in the V8 engine internals. Perhaps you could point me to a article explaining what to do. Thank you.