File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/beacon-node/src/network/gossip Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ export class DataTransformSnappy implements DataTransform {
104104 }
105105
106106 // Only after sanity length checks, we can decompress the data
107- // using Buffer.allocUnsafe () caused huge MarkSweepCompact gc on the main thread of sas nodes
107+ // Using Buffer.alloc () instead of Buffer.allocUnsafe() to mitigate high GC pressure observed in some environments
108108 const uncompressedData = Buffer . alloc ( uncompressedDataLength ) ;
109109 decoder . decompress_into ( data , uncompressedData ) ;
110110 return uncompressedData ;
@@ -121,7 +121,7 @@ export class DataTransformSnappy implements DataTransform {
121121 throw Error ( `ssz_snappy encoded data length ${ data . length } > ${ this . maxSizePerMessage } ` ) ;
122122 }
123123
124- // using Buffer.allocUnsafe () caused huge MarkSweepCompact gc on the main thread of sas nodes
124+ // Using Buffer.alloc () instead of Buffer.allocUnsafe() to mitigate high GC pressure observed in some environments
125125 const compressedData = Buffer . alloc ( snappyWasm . max_compress_len ( data . length ) ) ;
126126 const compressedLen = encoder . compress_into ( data , compressedData ) ;
127127 return compressedData . subarray ( 0 , compressedLen ) ;
You can’t perform that action at this time.
0 commit comments