aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack O'Connor <[email protected]>2022-02-13 18:22:36 -0500
committerJack O'Connor <[email protected]>2022-06-19 14:29:34 -0700
commite59b7faec3d6c1a7bc3df6d8585ff6dbdaaa359d (patch)
treef9d05f22ff15e53d1aad1d9de3ec7cedac0af3eb
parent164ae68871940bd05385e3ad9301c18b0353a52f (diff)
build b3sum automatically in bench.pymmap_fromthefront
-rwxr-xr-xb3sum/bench.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/b3sum/bench.py b/b3sum/bench.py
index 73a413c..088bf6a 100755
--- a/b3sum/bench.py
+++ b/b3sum/bench.py
@@ -1,10 +1,12 @@
#! /usr/bin/env python3
import os
+from os import path
import subprocess
import sys
import time
+HERE = path.dirname(__file__)
NUM_RUNS = 5
@@ -18,7 +20,7 @@ def one_run():
)
start = time.monotonic()
subprocess.run(
- sys.argv[1:],
+ [path.join(HERE, "target/release/b3sum")] + sys.argv[1:],
stdout=subprocess.DEVNULL,
check=True,
)
@@ -40,6 +42,11 @@ def median_run():
def main():
+ subprocess.run(
+ ["cargo", "build", "--release"],
+ check=True,
+ cwd=HERE,
+ )
t = median_run()
print()
print("{:.3f}".format(t))