We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09277ff commit 6f1f8d4Copy full SHA for 6f1f8d4
lib/parser.js
@@ -348,11 +348,10 @@ function concatBuffer (parser, length) {
348
var pos = bufferOffset
349
length -= parser.offset
350
if (bufferPool.length < length + bufferOffset) {
351
- // Increase the bufferPool size by three times the current needed length
352
- var multiplier = 3
353
- if (bufferOffset > 1024 * 1024 * 200) {
+ // Increase the bufferPool size
+ var multiplier = length > 1024 * 1024 * 75 ? 2 : 3
+ if (bufferOffset > 1024 * 1024 * 120) {
354
bufferOffset = 1024 * 1024 * 50
355
- multiplier = 2
356
}
357
bufferPool = new Buffer(length * multiplier + bufferOffset)
358
bufferOffset = 0
0 commit comments