Skip to content

Commit f0e4cc9

Browse files
committed
Update to add generation time; update github actions to use spearate files for linux and windows
1 parent d2d4e32 commit f0e4cc9

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

analyze_benchmarks.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pathlib import Path
66
import argparse # Add argparse for command line arguments
77
import cpuinfo
8+
import datetime # Add datetime for generation timestamp
89

910
def parse_benchmark_results(file_path):
1011
"""Parse benchmark results from file."""
@@ -165,6 +166,9 @@ def plot_comparisons(grouped_benchmarks, output_dir):
165166
output_path = Path(output_dir)
166167
output_path.mkdir(parents=True, exist_ok=True)
167168

169+
# Get current timestamp for the generation time
170+
generation_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
171+
168172
# Collect data for consolidated plot
169173
categories = []
170174
simd_times = []
@@ -247,11 +251,16 @@ def format_speedup(value, pos):
247251
)
248252

249253
# Position the text box on the top right
250-
# Adjust x and y coordinates as needed based on your plot's scale
251-
# Using axes coordinates (0 to 1 for x and y) for positioning relative to the plot area
252254
plt.text(0.80, 0.98, info_text, transform=plt.gca().transAxes,
253255
fontsize=9, verticalalignment='top', horizontalalignment='left',
254256
bbox=dict(boxstyle='round,pad=0.5', fc='wheat', alpha=0.5))
257+
258+
# Add generation time in a separate box below CPU info
259+
timestamp_text = f"Generated: {generation_time}"
260+
plt.text(0.65, 0.98, timestamp_text, transform=plt.gca().transAxes,
261+
fontsize=9, verticalalignment='top', horizontalalignment='left',
262+
bbox=dict(boxstyle='round,pad=0.5', fc='lightblue', alpha=0.5))
263+
255264
plt.savefig(output_path / "consolidated_speedup.png", dpi=300)
256265

257266
# Create a table plot with the data
@@ -294,6 +303,12 @@ def format_speedup(value, pos):
294303
table[(i+1, 3)].set_facecolor('#f4d5d5') # Light red
295304

296305
plt.title('SIMD vs Plain Performance Comparison Table', fontsize=16, pad=20)
306+
307+
# Add generation time in a box at the bottom of the table
308+
plt.figtext(0.5, 0.01, f"Generated: {generation_time}",
309+
ha='center', fontsize=10,
310+
bbox=dict(boxstyle='round,pad=0.5', fc='lightblue', alpha=0.5))
311+
297312
plt.tight_layout()
298313
plt.savefig(output_path / "comparison_table.png", dpi=300, bbox_inches='tight')
299314

run_tests.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake -S . -B build
22
cmake --build build\ --config Release
3-
.\build\Release\BasicSIMD_Tests.exe > test_results.txt
3+
.\build\Release\BasicSIMD_Tests.exe > test_results_windows.txt
44

5-
python analyze_benchmarks.py --input_file=test_results.txt --output_dir=benchmark_results_windows_msvc/
5+
python analyze_benchmarks.py --input_file=test_results_windows.txt --output_dir=benchmark_results_windows_msvc/

run_tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ cmake -DCMAKE_BUILD_TYPE=Release -S . -B build
77
cmake --build build --config Release
88

99
# Run the tests
10-
./build/BasicSIMD_Tests > test_results.txt
10+
./build/BasicSIMD_Tests > test_results_linux.txt
1111

1212
# Generate benchmark analysis
13-
python3 analyze_benchmarks.py --input_file=test_results.txt --output_dir=benchmark_results_linux_gcc/
13+
python3 analyze_benchmarks.py --input_file=test_results_linux.txt --output_dir=benchmark_results_linux_gcc/
1414

1515
# Make the output more readable
1616
echo "Test execution completed, plots saved to benchmark_results/ directory and README.md updated."

0 commit comments

Comments
 (0)