aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets/process.mjs
blob: 8e7bc2a03221e6116c6cbf090a3975c6efa7df97 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { bench, run } from "mitata";

bench("process.stderr.write('hey')", () => {
  process.stderr.write("hey");
});

const long = "hey".repeat(10000);
bench("process.stderr.write('hey'.repeat(10_000))", () => {
  process.stderr.write(long);
});

const longUTF16 = "🥟🐰".repeat(10000);
bench("process.stderr.write('🥟🐰')", () => {
  process.stderr.write("🥟🐰");
});

bench("process.stderr.write('🥟🐰'.repeat(10_000))", () => {
  process.stderr.write(longUTF16);
});

await run();