Skip to content

Commit

Permalink
Add new benchmark for new computer and new version
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Oct 30, 2023
1 parent 72dc016 commit fdb2682
Show file tree
Hide file tree
Showing 7 changed files with 534 additions and 15 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions benches/logbench.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python3
"""Run `cargo bench`, print the output with CPU information to a timestamped
file.
Does not work on Windows (WSL works).
"""


Expand Down Expand Up @@ -42,7 +44,7 @@ def get_cpu_info() -> str:
cmd = ["sysctl", "-n", "machdep.cpu.brand_string"]
s += decode_sp_out(sp.check_output(cmd))
else:
tmp = sp.check_output("lscpu")
tmp = decode_sp_out(sp.check_output("lscpu"))
for line in tmp.splitlines():
if (
"Architecture" in line
Expand All @@ -63,7 +65,7 @@ def main():
fname, fpath = get_fpath(dtime, describe)
version = rustc_version()
cpu_info = get_cpu_info()
cmd = ["cargo", "bench", "--features", "benchmarking"]
cmd = ["cargo", "bench", "--features", "unstable-bench"]
cmd += sys.argv[1:]

header_str = (
Expand Down Expand Up @@ -100,7 +102,7 @@ def main():
time_str = f"\nTotal execution time: {time.strftime('%H:%M:%S', time.gmtime(elapsed_time))}"
output += time_str
print(time_str)
print("\nWriting file...", end="")
print("\nWriting file '{fpath}'...", end="")

with open(fpath, "w") as f:
f.write(output)
Expand Down
Loading

0 comments on commit fdb2682

Please sign in to comment.