From c8898d5ad9cc8d8cb55e331a8796752fb57f2727 Mon Sep 17 00:00:00 2001 From: Saveliy Yusufov Date: Thu, 8 Feb 2024 16:32:21 -0500 Subject: [PATCH] Format benchmark scripts --- Cargo.toml | 2 +- benches/benchmark.sh | 3 +-- benches/py_benchmarks.py | 13 +++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f2d1f4d..17b00e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" authors = ["Saveliy Yusufov", "Shnatsel"] license = "MIT OR Apache-2.0" description = "A high-performance, quantum-inspired, implementation of FFT in pure Rust" -repository = "https://github.com/QuState/PHastFT" +repository = "https://github.com/QuState/PhastFT" keywords = ["quantum", "fft", "discrete", "fourier", "transform"] categories = ["algorithms", "compression", "science"] diff --git a/benches/benchmark.sh b/benches/benchmark.sh index 201cb53..fa797b7 100755 --- a/benches/benchmark.sh +++ b/benches/benchmark.sh @@ -20,9 +20,8 @@ benchmark_fftw3() { make clean && make for n in $(seq "$start" "$end"); do - # clamp to `max_iters` iters=$((2**($end - $n))) - iters=$((iters > max_iters ? max_iters : iters)) + iters=$((iters > max_iters ? max_iters : iters)) # clamp to `max_iters` echo "Running FFTW3 benchmark for N = 2^${n} for ${iters} iterations..." for _ in $(seq 1 "$iters"); do diff --git a/benches/py_benchmarks.py b/benches/py_benchmarks.py index 8ebb5b1..58c5cec 100644 --- a/benches/py_benchmarks.py +++ b/benches/py_benchmarks.py @@ -1,12 +1,13 @@ +import csv +import time + +import matplotlib.pyplot as plt import numpy as np import pandas as pd import pyfftw -import time -import csv -import matplotlib.pyplot as plt +from pybindings import fft from utils import bytes2human -from pybindings import fft plt.style.use("fivethirtyeight") @@ -119,7 +120,7 @@ def plot_elapsed_times(data: dict) -> None: plt.plot(index, np_fft_timings, label="NumPy FFT", lw=0.8) plt.plot(index, pyfftw_timings, label="PyFFTW FFT", lw=0.8) - plt.plot(index, phastft_timings, label="PhastFT", lw=0.98) + plt.plot(index, phastft_timings, label="PhastFT", lw=0.8) plt.title("FFT Elapsed Times Comparison") plt.xticks(fontsize=9, rotation=-45) @@ -149,7 +150,7 @@ def grouped_bar_plot(data: dict): index=index, ) - ax = df.plot(kind="bar", linewidth=3, rot=0) + _ax = df.plot(kind="bar", linewidth=3, rot=0) plt.title("FFT Elapsed Times Comparison") plt.xticks(fontsize=9, rotation=-45) plt.yticks(fontsize=9)