Make request.method getter not allocate memory (#18961)

This commit is contained in:
Jarred Sumner
2025-04-11 20:59:38 -07:00
committed by GitHub
parent 879fdd7ef6
commit acf0b68299
10 changed files with 354 additions and 192 deletions

View File

@@ -0,0 +1,14 @@
import { bench, run } from "../runner.mjs";
const url = "http://localhost:3000/";
const clonable = new Request(url);
bench("request.clone().method", () => {
return clonable.clone().method;
});
bench("new Request(url).method", () => {
return new Request(url).method;
});
await run();