-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
89 lines (71 loc) · 1.88 KB
/
Justfile
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
set quiet
# test the library with all features
test:
just install-nextest
echo "testing..."
cargo nextest run -F full
echo "done!"
doc:
echo "generating documentation..."
cargo +nightly doc --all-features
echo "done!"
# benchmark the js and rust vbml implementations
bench:
echo "benchmarking js and rust..."
just bench-js-native
just bench-rs-native
just interpret
echo "done!"
# benchmark the js vbml implementations
bench-js:
echo "benchmarking js..."
just bench-js-native
# benchmark the rust vbml implementations
bench-rs:
just install-cargo-criterion
echo "benchmarking rust..."
just bench-rs-native
# benchmark the rust vbml implementations with flamegraph
flame $CARGO_PROFILE_BENCH_DEBUG="true":
just install-flamegraph
echo "profiling rust..."
cargo flamegraph -o benchmark/out/flamegraph.svg --open --bench vbml -- --bench
echo "done!"
# interpret the js and rust results
interpret:
echo "interpreting results..."
cargo run --example interpret
[private]
bench-js-native:
#!/usr/bin/env bash
cd benchmark/js
echo "installing dependencies..."
npm install &> /dev/null
echo "running js benchmarks..."
npm run bench
[private]
bench-rs-native:
echo "running rust benchmarks..."
cargo criterion --message-format=json > /tmp/vestaboard-rs-criterion.json
jq -s < /tmp/vestaboard-rs-criterion.json > benchmark/out/rust.json
[private]
install-cargo-criterion:
#!/usr/bin/env bash
if ! command -v cargo-criterion &> /dev/null; then
echo "installing cargo-criterion..."
cargo install cargo-criterion
fi
[private]
install-flamegraph:
#!/usr/bin/env bash
if ! command -v flamegraph &> /dev/null; then
echo "installing flamegraph..."
cargo install flamegraph
fi
[private]
install-nextest:
#!/usr/bin/env bash
if ! command -v nextest &> /dev/null; then
echo "installing nextest..."
cargo install nextest
fi