1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-11 08:33:43 -05:00

perf: Increase copy() buffer to 32k

This will improve the threshold benchmark. Using 32k because that's what
Go uses, but we should explore the value in the future.
a0d6420d8b/src/io/io.go (L391)
This commit is contained in:
Ryan Dahl 2018-10-11 17:35:14 -04:00
parent 298d755152
commit c9f95d51da

View file

@ -101,7 +101,7 @@ export interface ReadWriteSeeker extends Reader, Writer, Seeker {}
// https://golang.org/pkg/io/#Copy
export async function copy(dst: Writer, src: Reader): Promise<number> {
let n = 0;
const b = new Uint8Array(1024);
const b = new Uint8Array(32*1024);
let gotEOF = false;
while (gotEOF === false) {
const result = await src.read(b);