-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.py
More file actions
66 lines (58 loc) · 2.57 KB
/
Copy pathplot.py
File metadata and controls
66 lines (58 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import matplotlib.pyplot as plt
x = [1, 2, 4, 6, 8, 16, 32]
t = [14732.21459388733, 11916.088390350342, 6168.164920806885, 4987.28129863739, 4474.0747928619385, 4582.453298568726,
4894.485187530518]
s = [1.2363297511134181, 2.388427479328835, 2.9539570182079804, 3.292795779228257, 3.214918654705932, 3.009962034703874]
N = [1, 5, 10, 15, 20]
t_1 = [14732.21459388733, 67572.49672412872, 103763.5468006134, 175158.37271213531, 231178.47292423248]
t_2 = [11916.088390350342, 59630.9987783432, 118087.90957927704, 177494.13681030273, 236431.7348241806]
t_4 = [6168.164920806885, 30976.357984542847, 61603.863310813904, 92459.2268705368, 123421.98917865753]
t_6 = [4987.28129863739, 24618.072414398193, 48769.06292438507, 73439.30640220642, 98029.08899784088]
t_8 = [4474.0747928619385, 22430.921602249146, 43495.72694301605, 65019.10209655762, 87138.46881389618]
t_16 = [4582.453298568726, 22172.96450138092, 44495.99800109863, 66415.88990688324, 89093.41239929199]
t_32 = [4894.485187530518, 22653.416085243225, 44891.75910949707, 67775.2900838852, 90014.63778018951]
s_2 = [1.2363297511134181, 1.1331773424641969, 0.8786974650521091, 0.9868403309532203, 0.9777810626654893]
s_4 = [2.388427479328835, 2.1814216105665905, 1.6843675254113295, 1.8944390802379891, 1.8730736270146624, ]
s_6 = [2.9539570182079804, 2.7448329660695974, 2.1276510266661384, 2.385076620316131, 2.3582640141573106]
s_8 = [3.292795779228257, 3.0124708169526677, 2.38560323262454, 2.6939525010975034, 2.6530013215858332]
s_16 = [3.214918654705932, 3.0475174720060703, 2.3319748171071795, 2.6372961795394416, 2.5947875011022656]
s_32 = [3.009962034703874, 2.98288330863028, 2.3114163681472157, 2.584398716631718, 2.568231996764313]
if __name__ == '__main__':
plt.xticks(x)
plt.plot(x, t)
plt.title("Execution Time")
plt.ylabel("Time (ms)")
plt.xlabel('Number of threads')
plt.show()
x = x[1:]
plt.title("Speedups")
plt.xticks(x)
plt.plot(x, s)
plt.xlabel("Number of threads")
plt.ylabel('speedup')
plt.show()
plt.xticks(N)
plt.plot(N, t_1)
plt.plot(N, t_2)
plt.plot(N, t_4)
plt.plot(N, t_6)
plt.plot(N, t_8)
plt.plot(N, t_16)
plt.plot(N, t_32)
plt.title("Execution Time")
plt.xlabel("Number of passwords")
plt.ylabel('Time (ms)')
plt.legend(['1 thread', '2 threads', '4 threads', '6 threads', '8 threads', '16 threads', '32 threads'])
plt.show()
plt.xticks(N)
plt.plot(N, s_2)
plt.plot(N, s_4)
plt.plot(N, s_6)
plt.plot(N, s_8)
plt.plot(N, s_16)
plt.plot(N, s_32)
plt.title("Speedups")
plt.xlabel("Number of passwords")
plt.ylabel('Speedup')
plt.legend(['2 threads', '4 threads', '6 threads', '8 threads', '16 threads', '32 threads'])
plt.show()