summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-10-11 17:35:14 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-10-12 08:58:17 -0400
commitc9f95d51da9f6075b1f28a842dc830ec5fe7a30e (patch)
tree18fb870067d9e59deebc45d2fa3191e2bd990d0d
parent298d75515268315f8c24769555b604c534e15925 (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.ts2
1 files changed, 1 insertions, 1 deletions
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<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);