Skip to content

Commit

Permalink
Format benchmark scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
smu160 committed Feb 8, 2024
1 parent bebb6ac commit c8898d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
3 changes: 1 addition & 2 deletions benches/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions benches/py_benchmarks.py
Original file line number Diff line number Diff line change
@@ -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")

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c8898d5

Please sign in to comment.