buffer icon indicating copy to clipboard operation
buffer copied to clipboard

Use TextDecoder for Buffer.toString?

Open cmdcolin opened this issue 5 years ago • 2 comments

I have some pretty large buffers (~45MB) I'm decoding, and they can create a large "GC pressure"

With TextDecoder start: 42ms

With buffer.toString() start: 838.85302734375ms

I know there have been discussions about TextEncoder/TextDecoder in the past, but thought I'd mention the performance boost here

cmdcolin avatar Aug 06 '20 17:08 cmdcolin

Linking to #60 for reference

gsvarovsky avatar Sep 11 '20 07:09 gsvarovsky

I'm open to merging a PR that switches to TextDecoder. If you would like to see it implemented, please send a pull request!

feross avatar Nov 18 '20 02:11 feross