-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_bench.ts
More file actions
36 lines (28 loc) · 743 Bytes
/
main_bench.ts
File metadata and controls
36 lines (28 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { work_heap, work_noop, work_stack_only } from "./work.ts";
import {
worker_work_heap,
worker_work_noop,
worker_work_stack_only,
} from "./mod.ts";
//deno bench --allow-read
Deno.bench("work noop", () => {
work_noop();
});
Deno.bench("work stack only", () => {
work_stack_only();
});
Deno.bench("work heap", () => {
work_heap();
});
Deno.bench("worker work noop", async () => {
await worker_work_noop();
});
Deno.bench("worker work stack only", async () => {
await worker_work_stack_only();
});
Deno.bench("worker work heap", async () => {
await worker_work_heap();
});
Deno.bench("worker work heap concurrent", async () => {
await Promise.allSettled(Array.from(Array(5)).map(() => worker_work_heap()));
});