Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new benchmark for new computer and new version #80

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/validation-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-features --all-targets -- -D warnings
- run: cargo clippy --no-default-features --all-targets --features benchmarking -- -D warnings
- run: cargo clippy --no-default-features --all-targets --features unstable-bench -- -D warnings

min_versions:
name: check minimum rustc version
Expand All @@ -39,7 +39,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
# check only zspell; we can use later for the CLI
- run: cargo check -p zspell --all-features
- run: cargo check -p zspell --no-default-features --features benchmarking
- run: cargo check -p zspell --no-default-features --features unstable-bench

test:
strategy:
Expand Down
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
Loading