diff --git a/plot_benchmark.py b/plot_benchmark.py index 2df20a0..f13d5f5 100644 --- a/plot_benchmark.py +++ b/plot_benchmark.py @@ -14,7 +14,7 @@ wavelets = sorted(set(b['wavelet'] for b in data['benchmarks'])) # Set up the plot -fig, axes = plt.subplots(2, 1, figsize=(12, 10)) +fig, axes = plt.subplots(len(sizes) + 1, 1, figsize=(12, 10)) if include_discrete_wavelets: fig.suptitle('Wasmlets vs Pywavelets vs Discrete-Wavelets Performance Comparison') else: @@ -72,5 +72,21 @@ ax.legend() ax.grid(True, alpha=0.3) + +ax = axes[-1] + +wasmlets_load = data['initializationTimings']['wasmlets'] +pywavelets_load = data['initializationTimings']['pyodide'] +ax.bar(0, wasmlets_load, width=bar_width, label='Wasmlets', color='skyblue') +ax.bar(1, pywavelets_load, width=bar_width, label='Pyodide+Pywt', color='coral') +ax.set_xticks([0, 1]) +ax.set_xticklabels(['Wasmlets', 'Pyodide + Pywavelets']) +# log plot +ax.set_yscale('log') +ax.set_ylabel('Time (log ms)') +ax.legend() +ax.set_title('Startup') + + plt.tight_layout() plt.savefig('output/benchmark.png', dpi=300, bbox_inches='tight')