-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathperf
More file actions
40 lines (32 loc) · 813 Bytes
/
perf
File metadata and controls
40 lines (32 loc) · 813 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
37
38
39
40
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# ///
"""Run the performance benchmark (fbuild-rust vs fbuild-python vs platformio).
Usage:
uv run perf # run the benchmark
uv run perf --nocapture # (default) show output as it runs
"""
import subprocess
import sys
from pathlib import Path
SCRIPT_DIR = Path(__file__).parent.resolve()
def main():
cmd = [
"uv", "run", "cargo", "test",
"-p", "fbuild-daemon",
"--test", "perf_bench_test",
"--",
"--nocapture",
"--ignored",
]
result = subprocess.run(
cmd,
text=True,
encoding="utf-8",
errors="replace",
cwd=str(SCRIPT_DIR),
)
return result.returncode
if __name__ == "__main__":
sys.exit(main())