mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
1abff07392
This should give a performance boost accross the board. Given that the old limit is a decod old and memory capacity has doubled many times since I think it is appropriate to slightly bump the default limit. PR-URL: https://github.com/nodejs/node/pull/52037 Refs: https://github.com/nodejs/node/pull/46608 Refs: https://github.com/nodejs/node/pull/50120 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
34 lines
728 B
JavaScript
34 lines
728 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const { Readable } = require('stream');
|
|
|
|
const buf = Buffer.alloc(8192);
|
|
|
|
const readable = new Readable({
|
|
highWaterMark: 16 * 1024,
|
|
read: common.mustCall(function() {
|
|
this.push(buf);
|
|
}, 31)
|
|
});
|
|
|
|
let i = 0;
|
|
|
|
readable.on('readable', common.mustCall(function() {
|
|
if (i++ === 10) {
|
|
// We will just terminate now.
|
|
process.removeAllListeners('readable');
|
|
return;
|
|
}
|
|
|
|
const data = readable.read();
|
|
// TODO(mcollina): there is something odd in the highWaterMark logic
|
|
// investigate.
|
|
if (i === 1) {
|
|
assert.strictEqual(data.length, 8192 * 2);
|
|
} else {
|
|
assert.strictEqual(data.length, 8192 * 3);
|
|
}
|
|
}, 11));
|