Img
In [1]:
Copied!
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pyplot as plt
import numpy as np
In [9]:
Copied!
categories = ['O0','O1','O2']
labels = ['gcc/g++', 'clang/clang++']
data = np.array([[51624,51416],
[39008,34968],
[43048,67736] ])
bar_width = 0.2
x = np.arange(len(labels))
fig, ax = plt.subplots()
for i in range(len(categories)):
bars = ax.bar(x + i * bar_width, data[i], bar_width, label=categories[i])
# ax.bar(x + i * bar_width, data[i], bar_width, label=categories[i])
for bar in bars:
height = bar.get_height()
ax.annotate('{}'.format(height),
xy=(bar.get_x() + bar.get_width() / 2, height),
xytext=(0, 3),
textcoords="offset points",
ha='center', va='bottom')
ax.set_xlabel('compiler')
ax.set_ylabel('executable file sizes')
ax.set_title('2 compilers with 3 optimization levels')
ax.set_xticks(x + bar_width)
ax.set_xticklabels(labels)
ax.legend()
plt.show()
categories = ['O0','O1','O2']
labels = ['gcc/g++', 'clang/clang++']
data = np.array([[51624,51416],
[39008,34968],
[43048,67736] ])
bar_width = 0.2
x = np.arange(len(labels))
fig, ax = plt.subplots()
for i in range(len(categories)):
bars = ax.bar(x + i * bar_width, data[i], bar_width, label=categories[i])
# ax.bar(x + i * bar_width, data[i], bar_width, label=categories[i])
for bar in bars:
height = bar.get_height()
ax.annotate('{}'.format(height),
xy=(bar.get_x() + bar.get_width() / 2, height),
xytext=(0, 3),
textcoords="offset points",
ha='center', va='bottom')
ax.set_xlabel('compiler')
ax.set_ylabel('executable file sizes')
ax.set_title('2 compilers with 3 optimization levels')
ax.set_xticks(x + bar_width)
ax.set_xticklabels(labels)
ax.legend()
plt.show()
In [11]:
Copied!
categories = ['O0','O1','O2']
labels = ['gcc/g++', 'clang/clang++']
data = np.array([[26.74,52.25],
[2.12,2.13],
[2.14,0.45] ])
bar_width = 0.2
x = np.arange(len(labels))
fig, ax = plt.subplots()
for i in range(len(categories)):
bars = ax.bar(x + i * bar_width, data[i], bar_width, label=categories[i])
for bar in bars:
height = bar.get_height()
ax.annotate('{}'.format(height),
xy=(bar.get_x() + bar.get_width() / 2, height),
xytext=(0, 3),
textcoords="offset points",
ha='center', va='bottom')
ax.set_xlabel('compiler')
ax.set_ylabel('Total absolute time')
ax.set_title('for loop unused induction copy')
ax.set_xticks(x + bar_width)
ax.set_xticklabels(labels)
ax.legend()
plt.show()
categories = ['O0','O1','O2']
labels = ['gcc/g++', 'clang/clang++']
data = np.array([[26.74,52.25],
[2.12,2.13],
[2.14,0.45] ])
bar_width = 0.2
x = np.arange(len(labels))
fig, ax = plt.subplots()
for i in range(len(categories)):
bars = ax.bar(x + i * bar_width, data[i], bar_width, label=categories[i])
for bar in bars:
height = bar.get_height()
ax.annotate('{}'.format(height),
xy=(bar.get_x() + bar.get_width() / 2, height),
xytext=(0, 3),
textcoords="offset points",
ha='center', va='bottom')
ax.set_xlabel('compiler')
ax.set_ylabel('Total absolute time')
ax.set_title('for loop unused induction copy')
ax.set_xticks(x + bar_width)
ax.set_xticklabels(labels)
ax.legend()
plt.show()
In [12]:
Copied!
categories = ['O0','O1','O2']
labels = ['gcc/g++', 'clang/clang++']
data = np.array([[35.8,85.38],
[10.89,8.34],
[9.29,4.84] ])
bar_width = 0.2
x = np.arange(len(labels))
fig, ax = plt.subplots()
for i in range(len(categories)):
bars = ax.bar(x + i * bar_width, data[i], bar_width, label=categories[i])
for bar in bars:
height = bar.get_height()
ax.annotate('{}'.format(height),
xy=(bar.get_x() + bar.get_width() / 2, height),
xytext=(0, 3),
textcoords="offset points",
ha='center', va='bottom')
ax.set_xlabel('compiler')
ax.set_ylabel('Total absolute time')
ax.set_title('for loop induction copy')
ax.set_xticks(x + bar_width)
ax.set_xticklabels(labels)
ax.legend()
plt.show()
categories = ['O0','O1','O2']
labels = ['gcc/g++', 'clang/clang++']
data = np.array([[35.8,85.38],
[10.89,8.34],
[9.29,4.84] ])
bar_width = 0.2
x = np.arange(len(labels))
fig, ax = plt.subplots()
for i in range(len(categories)):
bars = ax.bar(x + i * bar_width, data[i], bar_width, label=categories[i])
for bar in bars:
height = bar.get_height()
ax.annotate('{}'.format(height),
xy=(bar.get_x() + bar.get_width() / 2, height),
xytext=(0, 3),
textcoords="offset points",
ha='center', va='bottom')
ax.set_xlabel('compiler')
ax.set_ylabel('Total absolute time')
ax.set_title('for loop induction copy')
ax.set_xticks(x + bar_width)
ax.set_xticklabels(labels)
ax.legend()
plt.show()
In [16]:
Copied!
categories = ['O0','O1','O2']
labels = ['gcc/g++', 'clang/clang++']
data = np.array([[26.74/35.8,52.25/85.38],
[2.12/10.89,2.13/8.34],
[2.14/9.29,0.45/4.84] ])
data = 1 - data
data = np.round(data, 3)
bar_width = 0.2
x = np.arange(len(labels))
fig, ax = plt.subplots()
for i in range(len(categories)):
bars = ax.bar(x + i * bar_width, data[i], bar_width, label=categories[i])
for bar in bars:
height = bar.get_height()
ax.annotate('{}'.format(height),
xy=(bar.get_x() + bar.get_width() / 2, height),
xytext=(0, 3),
textcoords="offset points",
ha='center', va='bottom')
ax.set_xlabel('compiler')
ax.set_ylabel('Use Ratio')
ax.set_title('for loop induction copy')
ax.set_xticks(x + bar_width)
ax.set_xticklabels(labels)
ax.legend()
plt.show()
categories = ['O0','O1','O2']
labels = ['gcc/g++', 'clang/clang++']
data = np.array([[26.74/35.8,52.25/85.38],
[2.12/10.89,2.13/8.34],
[2.14/9.29,0.45/4.84] ])
data = 1 - data
data = np.round(data, 3)
bar_width = 0.2
x = np.arange(len(labels))
fig, ax = plt.subplots()
for i in range(len(categories)):
bars = ax.bar(x + i * bar_width, data[i], bar_width, label=categories[i])
for bar in bars:
height = bar.get_height()
ax.annotate('{}'.format(height),
xy=(bar.get_x() + bar.get_width() / 2, height),
xytext=(0, 3),
textcoords="offset points",
ha='center', va='bottom')
ax.set_xlabel('compiler')
ax.set_ylabel('Use Ratio')
ax.set_title('for loop induction copy')
ax.set_xticks(x + bar_width)
ax.set_xticklabels(labels)
ax.legend()
plt.show()