Skip to content

Commit 19bc7e4

Browse files
committed
stream: use fast-path for only large inputs
1 parent 7013248 commit 19bc7e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/streams/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ function isErrored(stream) {
278278
function encodeWithFastPath(input, encoding) {
279279
const enc = normalizeEncoding(encoding);
280280

281-
if (enc === 'utf8') {
281+
if (enc === 'utf8' && TypedArrayPrototypeGetByteLength(input) > 512) {
282282
const buf = encoder.encode(input);
283283
return new FastBuffer(
284284
TypedArrayPrototypeGetBuffer(buf),

0 commit comments

Comments
 (0)