add threads per timing plot #7

Open
mirjagr wants to merge 1 commit from mirjagr/2024-heraklion-parallel-python:parallel_python into main
2 changed files with 9 additions and 2 deletions
Showing only changes of commit af1125f477 - Show all commits

View file

@ -7,6 +7,7 @@ threads, timings = [], []
for file in os.listdir('timings'): for file in os.listdir('timings'):
with open(f'timings/{file}', 'r') as f: with open(f'timings/{file}', 'r') as f:
n, t = f.read().strip().split(',') n, t = f.read().strip().split(',')
if n != 'None':
threads.append(int(n)) threads.append(int(n))
timings.append(float(t)) timings.append(float(t))
threads = np.array(threads) threads = np.array(threads)
@ -20,4 +21,10 @@ fig, axs = plt.subplots()
# Remember to label your axis # Remember to label your axis
# Feel free to make it pretty # Feel free to make it pretty
axs.scatter(threads, timings)
axs.set_xlabel("Number of Threads")
axs.set_ylabel("Timings in seconds")
axs.grit = True
plt.savefig('threads_v_timings.png', dpi=300) plt.savefig('threads_v_timings.png', dpi=300)

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB