diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-10-11 17:35:14 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-12 08:58:17 -0400 |
commit | c9f95d51da9f6075b1f28a842dc830ec5fe7a30e (patch) | |
tree | 18fb870067d9e59deebc45d2fa3191e2bd990d0d | |
parent | 298d75515268315f8c24769555b604c534e15925 (diff) |
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
-rw-r--r-- | js/io.ts | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |