<jupyter_start><jupyter_text>Normalized Performance vs Baseline (Fig-15: 4-Core Weighted Speedup Metric)<jupyter_code>import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns; sns.set()
sns.set_style("whitegrid")
import matplotlib.ticker as mtick
import matplotlib
%matplotlib notebook
matplotlib.ticker._mathdefault = lambda x: '\\mathdefault{%s}'%x
#Get Non-Type-3 Fonts
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42

#Color Palette
color_palette_bar_plot = ['xkcd:blue', 'xkcd:aqua', 'xkcd:coral', 'xkcd:yellowgreen', 'xkcd:ivory', 'xkcd:magenta']
bar_pattern = ["/", ".", "*", "o", "+", "x"]

#Set Font Size
plt.rc('font', family='serif')
plt.rc('font', size='9')

# Read Dataframe
df = pd.read_csv("../stats_scripts/data/perf.stat", delimiter='\s+')
#print (df)

# Set position of bar on X axis
#barwidth
barWidth = 0.26
r1 = np.arange(len(df.index))
r2 = [x + barWidth for x in r1]
r3 = [x + barWidth for x in r2]

#Create Plot
fig = plt.figure(figsize=(8,2.1))
ax = plt.gca()
#Bars
plt.bar(r2, df['scatter-cache'], width = barWidth, color=sns.xkcd_rgb["pale green"], label='Scatter-Cache',hatch="\\\\\\\\", zorder=10,edgecolor="black",linewidth=1)
plt.bar(r3, df['MIRAGE'], width = barWidth, color=sns.xkcd_rgb["bright red"],label='Mirage',zorder=10)
#Y=1 Black Line
ax.plot([-0.75,len(df.index)+0.25], [1,1],zorder=0,color='black')

# Add xticks on the middle of the group bars
df.at[28,'Expts'] = " "
print (df)
plt.xticks([(r+barWidth*2) for r in range(len(df.index))], df['Expts'])
ax.set_xlim(-0.75,len(df.index)+0.25)
plt.xticks(rotation = 45,ha='right')
ax.tick_params(axis='x', which='major', labelsize=7)
for tick in ax.xaxis.get_major_ticks():
    tick_str = tick.label1.get_text()
    if( (tick_str == "Spec-14") or (tick_str == "Mix-14") or (tick_str == "All-28")):
        tick.label1.set_weight('bold')


#Add Y-axes labels
plt.ylabel('Norm. Performance (%)', size=8.5)
ax.tick_params(axis='y', which='major', labelsize=8)

#Set Y format & limts
ax.yaxis.set_major_formatter(mtick.PercentFormatter(1,0))
ax.set_ylim(0.96,1.04)
ax.set_yticks([0.96,0.97,0.98,0.99,1.00,1.01,1.02,1.03,1.04])

#grid
ax.axis('on')
ax.xaxis.grid()
plt.legend(loc='best', bbox_to_anchor=(0.375,0.53),prop={'size': 10.5})


#Text
ax.text(30.3,1.025, 'Gmean', family='serif',size='10',weight='bold',
        ha='center', va='center')


#Figure
plt.tight_layout()
fig.savefig("perf.pdf",bbox_inches='tight')
plt.show()<jupyter_output><empty_output><jupyter_text>Performance vs Encryptor Latency<jupyter_code>import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns; sns.set()
#sns.set_style("whitegrid")
from matplotlib.ticker import PercentFormatter
import matplotlib
%matplotlib notebook
matplotlib.ticker._mathdefault = lambda x: '\\mathdefault{%s}'%x
#Get Non-Type-3 Fonts
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42


#Set Font Size
plt.rc('font', family='serif')
plt.rc('font', size='12')

#Read Dataframe
df = pd.read_csv("../stats_scripts/data/perf.EncLat.stat", delimiter='\s+')
print (df)

#Color Palette
color_palette_bar_plot = ['xkcd:blue', 'xkcd:aqua', 'xkcd:coral', 'xkcd:yellowgreen', 'xkcd:ivory', 'xkcd:magenta']
bar_pattern = ["/", ".", "*", "o", "+", "x"]

# Set position of bar on X axis
barWidth = 0.25
r1 = np.arange(len(df.index))
r2 = [x + barWidth for x in r1]
r3 = [x + barWidth for x in r2]

# plot bars
plt.bar(r2, df['Scatter-Cache'], width = barWidth, color=sns.xkcd_rgb["pale green"],hatch ="\\\\\\\\", label='Scatter-Cache',zorder=10,edgecolor="black")
plt.bar(r3, df['MIRAGE'], width = barWidth, color=sns.xkcd_rgb["bright red"],label='Mirage',zorder=10)
ax = plt.gca()
# line at y=1
ax.plot([-0.75,len(df.index)+0.25], [1,1],zorder=0,color='black')

# axes labels
plt.ylabel('Norm. Performance (%)', size=11)

# add x-ticks
plt.xticks([(r+barWidth) for r in range(len(df.index))], df['EncrLat'])
ax.set_xlim(-0.5,len(df.index))

# set y-ticks format & limts
ax.set_ylim(0.96,1.04)
ax.set_yticks(np.arange (0.96, 1.04, 0.01))
#ax.set_ylim(0.99,1.02)
#ax.set_yticks([0.99,0.995,1,1.005, 1.01,1.015,1.02])
ax.yaxis.set_major_formatter(PercentFormatter(1,0))

# Tick size
ax.tick_params(axis='both', which='major', labelsize=11)

# legend
ax.legend(loc='upper left', bbox_to_anchor=(0, 1.04), prop={'size': 12})

# Save and Show Figure
fig = plt.gcf()
fig.set_figheight(2.1)
fig.set_figwidth(5.5)
plt.tight_layout()
fig.savefig("sens_encr_latency.pdf",bbox_inches='tight')
plt.show()<jupyter_output>EncrLat  Baseline  Scatter-Cache  MIRAGE
0        1       1.0          0.997   0.995
1        2       1.0          0.995   0.993
2        3       1.0          0.993   0.992
3        4       1.0          0.991   0.990
4        5       1.0          0.990   0.988<jupyter_text>Slowdown vs LLC Size (4-Core)<jupyter_code>import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns; sns.set()
#sns.set_style("whitegrid")
from matplotlib.ticker import PercentFormatter
import matplotlib
%matplotlib notebook
matplotlib.ticker._mathdefault = lambda x: '\\mathdefault{%s}'%x
#Get Non-Type-3 Fonts
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42


#Set Font Size
plt.rc('font', family='serif')
plt.rc('font', size='12')

# Read Dataframe
df = pd.read_csv("../stats_scripts/data/perf.LLCSz.stat", delimiter='\s+')
print (df)

# Color Palette
color_palette_bar_plot = ['xkcd:blue', 'xkcd:aqua', 'xkcd:coral', 'xkcd:yellowgreen', 'xkcd:ivory', 'xkcd:magenta']
bar_pattern = ["/", ".", "*", "o", "+", "x"]

# Set position of bar on X axis
barWidth = 0.25
r1 = np.arange(len(df.index))
r2 = [x + barWidth for x in r1]
r3 = [x + barWidth for x in r2]

# plot bars
plt.bar(r2, df['Scatter-Cache'], width = barWidth, color=sns.xkcd_rgb["pale green"],hatch ="\\\\\\\\", label='Scatter-Cache',zorder=10,edgecolor='black')
plt.bar(r3, df['MIRAGE'], width = barWidth, color=sns.xkcd_rgb["bright red"],label='Mirage',zorder=10)
ax = plt.gca()

# line at y=1
ax.plot([-0.75,len(df.index)+0.25], [1,1],zorder=0,color='black')

# axes labels
plt.ylabel('Norm. Performance (%)', size=11)

# add x-ticks
plt.xticks([(r+barWidth) for r in range(len(df.index))], df['LLCSz'])
ax.set_xlim(-0.5,len(df.index))

# set y-ticks format & limts
ax.set_ylim(0.96,1.02)
ax.set_yticks(np.arange (0.96, 1.02, 0.01))
ax.yaxis.set_major_formatter(PercentFormatter(1,0))

# Tick size
ax.tick_params(axis='both', which='major', labelsize=11)

# legend
ax.legend(loc='upper left', bbox_to_anchor=(0.32, 1.05), prop={'size': 10.5})

fig = plt.gcf()
fig.set_figheight(2.1)
fig.set_figwidth(5.5)
plt.tight_layout()
fig.savefig("sensitivity_cachesz.pdf",bbox_inches='tight')
plt.show()<jupyter_output>LLCSz  Baseline  Scatter-Cache  MIRAGE
0   2MB       1.0          0.981   0.979
1   4MB       1.0          0.986   0.985
2   8MB       1.0          0.993   0.992
3  16MB       1.0          0.991   0.990
4  32MB       1.0          0.979   0.978
5  64MB       1.0          0.988   0.986
{'fraction_non_alphanumeric': 0.1887719298245614, 'fraction_numerical': 0.057403508771929825, 'mean_word_length': 4.494217424826522, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '386764', 'license': 'MIT', 'n_tokens_mistral': 3175, 'n_tokens_neox': 2966, 'n_words': 580, 'path': 'perf_analysis/gem5/scripts/graphs/plot_graphs.ipynb', 'repo_name': 'gururaj-s/mirage', 'size': '7125'}