Closed Zazama closed 5 years ago
That is expected. We only load encoding tables into memory on demand, on the first call to encode/decode. The tables are large and it takes ~15ms to load them, so we'd like to avoid this cost if the app is not actually using the conversion. Does it make sense?
That makes sense, I just wasn't sure if it's intended, thank you!
Hello, I'm experiencing a kinda strange issue. My first execution of .encode/.decode is always way slower than following calls.
As you can see, I'm measuring the performance of an encode call that is looped. I've set a fixed string to make sure every string has the same length, but the issue also persists with variable/different strings. It also doesn't matter if it's a decode or encode call. I'm unsure of what is causing this and if it's an issue of iconv-lite or nodejs itself, so I wanted to ask if you have any ideas?
I'm using nodejs v10.15.3 and iconv-lite v0.5.0