78 lines
2.0 KiB
Python
78 lines
2.0 KiB
Python
import pandas as pd
|
|
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
|
|
def print_data(df):
|
|
print("=========================================")
|
|
print(df)
|
|
print("-----------------------------------------")
|
|
print(df.dtypes)
|
|
print("-----------------------------------------")
|
|
print(df.shape)
|
|
print("-----------------------------------------")
|
|
print(df.info())
|
|
|
|
def load_data(filename, columns):
|
|
df = pd.read_csv(filename, header = None, sep = "\s+", comment ='#')
|
|
df.columns = columns
|
|
df = df.dropna()
|
|
df[columns[0]] = df.year.astype(float)
|
|
print_data(df)
|
|
return df
|
|
|
|
df_cores = load_data("48yrs/cores.dat", ["year", "cores"])
|
|
df_frequency = load_data("48yrs/frequency.dat", ["year", "frequency"])
|
|
df_specint = load_data("48yrs/specint.dat", ["year", "specint"])
|
|
df_transistors = load_data("48yrs/transistors.dat", ["year", "transistors"])
|
|
df_watts = load_data("48yrs/watts.dat", ["year", "watts"])
|
|
|
|
violet = []
|
|
violet.append((196/255, 0/255, 84/255))
|
|
|
|
orange = []
|
|
orange.append((237/255, 109/255, 0/255))
|
|
|
|
yellow = []
|
|
yellow.append((252/255, 200/255, 0/255))
|
|
|
|
green = []
|
|
green.append((98/255, 178/255, 48/255))
|
|
|
|
blue = []
|
|
blue.append((48/255, 181/255, 197/255))
|
|
|
|
black = []
|
|
black.append((25/255, 24/255, 21/255))
|
|
|
|
|
|
x = df_transistors.year
|
|
y = df_transistors.transistors
|
|
plt.scatter(x, y, marker = "^", color = yellow)
|
|
|
|
x = df_specint.year
|
|
y = df_specint.specint
|
|
plt.scatter(x, y, marker = "s", color = blue)
|
|
|
|
x = df_frequency.year
|
|
y = df_frequency.frequency
|
|
plt.scatter(x, y, marker = "s", color = green)
|
|
|
|
x = df_watts.year
|
|
y = df_watts.watts
|
|
plt.scatter(x, y, marker = "v", color = violet)
|
|
|
|
x = df_cores.year
|
|
y = df_cores.cores
|
|
plt.scatter(x, y, marker = "o", color = black)
|
|
|
|
plt.yscale('log')
|
|
|
|
# plt.legend(loc="upper right", ["Cold", "Medium", "Hot"])
|
|
plt.legend(["Transistors (thousands)",
|
|
"Single-thread SPECint (thousands)",
|
|
"Frequency (MHz)",
|
|
"Typical power (Watts)",
|
|
"Number of logical cores"],
|
|
loc = "upper left")
|
|
|
|
plt.show() |