forked from SaltyAom/multi-ely
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbench.ts
42 lines (34 loc) · 844 Bytes
/
bench.ts
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
37
38
39
40
41
42
import { $ } from 'bun'
import { join } from 'path'
await $`cargo build --release`
let process
console.log("Elysia")
process = Bun.spawn({
cmd: ['bun', 'elysia/spawn.ts'],
env: {
...Bun.env,
NODE_ENV: 'production'
}
})
await Bun.sleep(1000)
await $`bash ./scripts/ely-wrk.sh`
process.kill(9 /* SIGKILL */)
await Bun.sleep(2000)
console.log("Axum")
process = Bun.spawn({
cmd: ['./target/release/axum-hello'],
cwd: join(import.meta.dirname, 'axum')
})
await Bun.sleep(1000)
await $`bash ./scripts/ely-wrk.sh`
process.kill(9 /* SIGKILL */)
await Bun.sleep(2000)
console.log("Actix")
process = Bun.spawn({
cmd: ['./target/release/actix-hello'],
cwd: join(import.meta.dirname, 'actix')
})
await Bun.sleep(1000)
await $`bash ./scripts/ely-wrk.sh`
process.kill(9 /* SIGKILL */)
await process.exited