From c9f95d51da9f6075b1f28a842dc830ec5fe7a30e Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 11 Oct 2018 17:35:14 -0400 Subject: 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. https://github.com/golang/go/blob/a0d6420d8be2ae7164797051ec74fa2a2df466a1/src/io/io.go#L391 --- js/io.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/io.ts b/js/io.ts index 710722f42..77ef79073 100644 --- a/js/io.ts +++ b/js/io.ts @@ -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 { 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); -- cgit v1.2.3