# Size if False or PLOT_ALL: with plot_settings(half_width=True): d = read_data(input_dir + f"{name}.csv", 1, 5) d = convert_to_gb(d) theo = {} for x in d: theo[x] = [bit_to_gb(comp_bloom_bits(x, 10**-20))] * 2 error_plot_mult( [d, theo], output_dir + f'size{EXTENSION}', 100000000, 0, 20, 4, "Capacity [#]", "Size [GB]", r"Bloom Filter Size (FP Rate: $1^{{-20}}$, Stored: To Cap., " r"10 Reps)", legend=Legend(['Measured', 'Theoretic'], location="upper left"), adjust=(LEFT_ADJUST, RIGHT_ADJUST, TOP_ADJUST, BOTTOM_ADJUST), xticks=xticks[:], xlabels=xlabels[:], x_label_step=2) # Query Time if False or PLOT_ALL: with plot_settings(half_width=True): d = read_data(input_dir + f"{name}.csv", 1, 7) # d = convert_to_minutes(d) error_plot_mult( [d],
# Fit lengths # new_data = {} # step = xticks[-1] / len(data.keys()) # for i, key in enumerate(sorted(data.keys())): # new_data[(i + 1) * step] = data[key] # data = new_data for i in range(len(xticks[:]) - 1, -1, -1): if xticks[i] < 0: del xticks[i] del x_labels[i] xstep = 0.5 min_y = 0 max_y = 20 y_step = 5 print(xticks, x_labels) error_plot_mult([data], output_file, xstep, min_y, max_y, y_step, xlabel, ylabel, title, xticks=xticks, xlabels=x_labels, ver_grid=True, x_rotation=90, auto_ylabels=True)
x_is_float=eval['x_float']) with open(input_dir + f"{eval['name']}.pyc", 'wb') as f: pickle.dump(d, f) for eval in evals: with plot_settings(half_width=eval['half_width']): with open(input_dir + f"{eval['name']}.pyc", 'rb') as f: d = pickle.load(f) error_plot_mult( [d], output_dir + f"{eval['out']}{EXTENSION}", eval['x_step'], 0, eval['y_max'] if 'y_max' in eval else 0, eval['y_step'] if 'y_step' in eval else 0, x_axis[eval['x']], y_label, eval['title'], adjust=eval['adjust'] if 'adjust' in eval else None, y_log=eval['y_log'], auto_ylabels=True if 'auto_y' not in eval else eval['auto_y'], y_lim=eval['y_lim'] if 'y_lim' in eval else None, y_lim_bottom=eval['y_lim_bottom'] if 'y_lim_bottom' in eval else None, xticks=eval['xticks'] if 'xticks' in eval else None, xlabels=eval['xlabels'] if 'xlabels' in eval else None, minor_xticks=eval['minor_xticks'] if 'minor_xticks' in eval else None, minor_xlabels=eval['minor_xlabels'] if 'minor_xlabels' in eval else None, )
hatches=hatches, y_lim=62) # RAM Plot if 0 or PLOT_ALL: output_file = output_dir + f'provider_ram{EXTENSION}' xlabel = "Uploads [#]" title = "Title" d = read_ram_max(input_dir + 'butthead_provider_uploads_ram' + '.csv', 2, 4) convert_mib_to_gb(d) error_plot_mult( [d], output_file, 100, 0, 35, 5, xlabel, "RAM Usage [GB]", r"Title", auto_ylabels=True, ) # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # Random Length Dependence # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- name = "butthead_provider_record_length" output_dir = output_dir_provider + "rand_length/" os.makedirs(output_dir, exist_ok=True)
output_dir = OUTPUT_DIR + 'bloom_insert_dep/' input_dir = INPUT_DIR + 'bloom_full_insert/' name = "butthead_bloom_insert" xticks = [i for i in range(0, 10**9 + 1, 10**8)] xlabels: List[str] = [0] + [f"{round(i / 10 ** 9, 1)} Bil" for i in xticks[1:]] BOTTOM_ADJUST = 0.22 RIGHT_ADJUST = 0.935 TOP_ADJUST = 0.97 LEFT_ADJUST = 0.15 # Insert Time if False or PLOT_ALL: with plot_settings(half_width=True): d = read_data(input_dir + f"{name}.csv", 3, 6) d = convert_to_minutes(d) error_plot_mult([d], output_dir + f'insert_time{EXTENSION}', 100000000, 0, 350, 50, "Inserted Elements [#]", "Insertion Time [min]", r"", x_label_step=2, auto_ylabels=True, adjust=(LEFT_ADJUST, RIGHT_ADJUST, TOP_ADJUST, BOTTOM_ADJUST), xticks=xticks, xlabels=xlabels)
f"{round(i / 10 ** 9, 1)} Bil" for i in xticks[1:]] BOTTOM_ADJUST = 0.22 RIGHT_ADJUST = 0.935 TOP_ADJUST = 0.97 LEFT_ADJUST = 0.11 # Query Time if False or PLOT_ALL: with plot_settings(half_width=True): d = read_data(input_dir + f"{name}.csv", 4, 7) d = convert_to_minutes(d) error_plot_mult( [d], output_dir + f'query_time{EXTENSION}', 100000000, 0, 350, 50, "Queries [#]", "Query Time [min]", r"Time for Query (FP Rate: $1^{{-20}}$, Stored: To Cap., " r"1Bil Queries, " "10 Reps)", x_label_step=2, auto_ylabels=True, adjust=(LEFT_ADJUST, RIGHT_ADJUST, TOP_ADJUST, BOTTOM_ADJUST), xticks=xticks, xlabels=xlabels )
d = read_data(input_dir + f"{name}.csv", 2, 5, x_is_float=True) d = convert_to_gb(d) theo = {} for x in d: theo[x] = [bit_to_gb(comp_bloom_bits(100000000, x))] * 2 error_plot_mult( [d, theo], output_dir + f'size{EXTENSION}', 100000000, 0, 1.5, 0.5, "FP Rate", "Size [GB]", "Bloom Filter Size (Capacity: 100Mio, Stored: To Cap., 10 Reps)", legend=Legend(['Measured', 'Theoretic'], location='upper left'), adjust=(LEFT_ADJUST, RIGHT_ADJUST, TOP_ADJUST, BOTTOM_ADJUST), xticks=xticks, xlabels=xlabels, minor_xticks=minor_xticks, minor_xlabels=minor_xlabels, log_base=10, x_log=True, x_sync=True, reverseX=True, ) # Query Time if False or PLOT_ALL: with plot_settings(half_width=True): d = read_data(input_dir + f"{name}.csv", 2, 7, x_is_float=True)
print("Runtime at 300ms: ", sum(data_list[300][10**7]) / len(data_list[300][10**7]), "min") latencies = sorted(data_list.keys(), reverse=True) legend_labels = [f"{i}ms" for i in latencies] legend_labels[-2] = " 50ms" legend_labels[-1] = " 0ms" xticks = list(range(0, 10**7 + 1, 2 * 10**6)) error_plot_mult( [data_list[i] for i in latencies], output_dir + f'{name}{EXTENSION}', 2 * 10**6, 0, 5, 1, "PSI Set Size [#]", "Time [min]", "PSI Execution Time w/ Latency(No TLS/MAL)", adjust=(0.11, 0.935, 0.76, 0.21), # for 2/3 Height (0.19, 0.93, 0.98, 0.16), legend=Legend(legend_labels, location='above'), x_label_step=1, y_lim=5, xticks=xticks, xlabels=[0] + [f"{i // 10 ** 6} Mio" for i in xticks[1:]]) # Bandwidth WITHOUT TLS ------------------------------------------------------- if False or PLOT_ALL: with plot_settings(half_width=True): name = "butthead_psi_bandwidth" data_list = read_data_mult(input_dir + f"bandwidth/{name}.csv", 2, 10, 8) bws = sorted(data_list.keys())[1:]