Review Buffer.from
usage
#6688
Labels
good first issue
Issues that are suitable for first-time contributors.
scope-performance
Performance issue and ideas to improve performance.
Review how
Buffer.from
is used within Lodestar, and check the following:Buffer
at all?Buffer
without memory copy?Eg. a good example of incorrect
Buffer.from
usagelodestar/packages/validator/src/slashingProtection/block/blockBySlotRepository.ts
Line 57 in 252fd2f
Which either should not be a
Buffer
at all as based on type aUint8Array
is valid, or ifBuffer
is required should avoid the memory copy.Depending on the size of the
Uint8Array
, converting toBuffer
with memory copy is quite expensive while without copy it's essentially freeFrom unstable...nflaig/bench-buffer-from
Related #6687
The text was updated successfully, but these errors were encountered: