You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently significantly improved some NodeJS compression work by pre-allocating two Buffers, one for read and one for compressed output data, then using readSync and writeSync directly into the existing Buffer instances. I also found similar gains from using fs.promises.FileHandle and reading into a set of preallocated Buffer instances when performing bulk uploads.
Since the FileSystem.readSync call also decodes the string, the original buffer is immediately freed and therefore all such calls in the process can reuse the same buffer and reduce GC.
Question
Answer
Package name:
@rushstack/node-core-library
Package version?
*
Operating system?
*
Would you consider contributing a PR?
Yes
Node.js version (node -v)?
18.19.1
The text was updated successfully, but these errors were encountered:
Summary
I recently significantly improved some NodeJS compression work by pre-allocating two
Buffer
s, one for read and one for compressed output data, then usingreadSync
andwriteSync
directly into the existingBuffer
instances. I also found similar gains from usingfs.promises.FileHandle
and reading into a set of preallocatedBuffer
instances when performing bulk uploads.Since the
FileSystem.readSync
call also decodes the string, the original buffer is immediately freed and therefore all such calls in the process can reuse the same buffer and reduce GC.node -v
)?The text was updated successfully, but these errors were encountered: