aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets/request-response-clone.mjs
blob: 05a98065602ab7f0dd84912d4c28efc1f11f5ebe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This mostly exists to check for a memory leak in response.clone()
import { bench, run } from "./runner.mjs";

const req = new Request("http://localhost:3000/");
const resp = await fetch("http://example.com");

bench("req.clone().url", () => {
  return req.clone().url;
});

bench("resp.clone().url", () => {
  return resp.clone().url;
});

await run();