Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132929 views
License: OTHER
1
import thinkplot
2
import matplotlib.pyplot as pyplot
3
4
d = {}
5
for line in open('data'):
6
t = line.split()
7
size, stride, time = int(t[1]), int(t[3]), float(t[5])
8
d.setdefault(stride, []).append((size, time))
9
10
11
thinkplot.PrePlot(num=7)
12
for stride in sorted(d.keys()):
13
if stride >= 512: continue
14
15
xs, ys = zip(*d[stride])
16
thinkplot.plot(xs, ys, label=str(stride))
17
print stride, len(d[stride])
18
19
pyplot.xscale('log', basex=2)
20
thinkplot.show(xlabel='size (B)', ylabel='access time (ns)')
21
22