The way string normalization is done is blocking and tough it would normally be fast, in case of an enormous string with many escaped characters the operation will be very slow and blocking. The easiest way to achieve this is by stringifying a json string and then parsing it back.
I'd suggest making it into a generator function so that it can yield and also looking for a way of speeding it up.
@toniuyt123 - thanks for raising this, and for the proposal! definitely looks promising; will make a try with that approach. Meanwhile, please feel free to contribute, if you are willing!
The way string normalization is done is blocking and tough it would normally be fast, in case of an enormous string with many escaped characters the operation will be very slow and blocking. The easiest way to achieve this is by stringifying a json string and then parsing it back. I'd suggest making it into a generator function so that it can yield and also looking for a way of speeding it up.