mirror of
https://github.com/denoland/deno.git
synced 2025-07-30 08:34:35 +00: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:
parent
298d755152
commit
c9f95d51da
1 changed files with 1 additions and 1 deletions
2
js/io.ts
2
js/io.ts
|
@ -101,7 +101,7 @@ export interface ReadWriteSeeker extends Reader, Writer, Seeker {}
|
||||||
// https://golang.org/pkg/io/#Copy
|
// https://golang.org/pkg/io/#Copy
|
||||||
export async function copy(dst: Writer, src: Reader): Promise<number> {
|
export async function copy(dst: Writer, src: Reader): Promise<number> {
|
||||||
let n = 0;
|
let n = 0;
|
||||||
const b = new Uint8Array(1024);
|
const b = new Uint8Array(32*1024);
|
||||||
let gotEOF = false;
|
let gotEOF = false;
|
||||||
while (gotEOF === false) {
|
while (gotEOF === false) {
|
||||||
const result = await src.read(b);
|
const result = await src.read(b);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue