-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathssr.js
117 lines (113 loc) · 2.68 KB
/
ssr.js
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { http } from './lib/bench.js'
const config = {
runs: 3, // number of runs for each framework
warmups: 1, // number of warmup runs
warmupDuration: 30, // duration of warmup runs
threads: 2, // wrk threads
duration: 30, // wrk duration
conn: 8, // wrk connections
quiet: false, // turn off terminal output
strace: true, // run bench with strace and capture output (linux only)
flame: true, // run bench with flamegraph and output to {name}.svg
nice: '20'
}
const pinning = ['1', '6,7']
const ssr = [
{
name: 'node-ssr-1',
cwd: 'ssr',
cmdline: 'node ssr-node.mjs 1',
port: 3000,
pinning: pinning,
// off: true
},
{
name: 'node-ssr-10',
cwd: 'ssr',
cmdline: 'node ssr-node.mjs 10',
port: 3000,
pinning: pinning,
// off: true
},
{
name: 'node-ssr-1000',
cwd: 'ssr',
cmdline: 'node ssr-node.mjs 1000',
port: 3000,
pinning: pinning,
// off: true
},
{
name: 'deno-ssr-1',
cwd: 'ssr',
cmdline: 'deno run -A --unstable-net ssr-deno.js 1',
port: 4000,
pinning: pinning,
// off: true
},
{
name: 'deno-ssr-10',
cwd: 'ssr',
cmdline: 'deno run -A --unstable-net ssr-deno.js 10',
port: 4000,
pinning: pinning,
// off: true
},
{
name: 'deno-ssr-1000',
cwd: 'ssr',
cmdline: 'deno run -A --unstable-net ssr-deno.js 1000',
port: 4000,
pinning: pinning,
// off: true
},
{
name: 'bun-ssr-1',
cwd: 'ssr',
cmdline: 'bun-profile ssr-bun.js 1',
port: 5000,
pinning: pinning, // optional, only works on linux - needs to be tuned for target machine
// off: true
},
{
name: 'bun-ssr-10',
cwd: 'ssr',
cmdline: 'bun-profile ssr-bun.js 10',
port: 5000,
pinning: pinning, // optional, only works on linux - needs to be tuned for target machine
// off: true
},
{
name: 'bun-ssr-1000',
cwd: 'ssr',
cmdline: 'bun-profile ssr-bun.js 1000',
port: 5000,
pinning: pinning, // optional, only works on linux - needs to be tuned for target machine
// off: true
},
{
name: 'lo-ssr-1',
cwd: 'ssr',
cmdline: 'lo ssr-lo.js 1',
port: 6000,
pinning: pinning, // optional, only works on linux - needs to be tuned for target machine
// off: true
},
{
name: 'lo-ssr-10',
cwd: 'ssr',
cmdline: 'lo ssr-lo.js 10',
port: 6000,
pinning: pinning, // optional, only works on linux - needs to be tuned for target machine
// off: true
},
{
name: 'lo-ssr-1000',
cwd: 'ssr',
cmdline: 'lo ssr-lo.js 1000',
port: 6000,
pinning: pinning, // optional, only works on linux - needs to be tuned for target machine
// off: true
},
]
await http({ ssr }, config)