Skip to content

Commit

Permalink
Update benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
jiep committed Jan 17, 2023
1 parent 6df8bcb commit 7002923
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "generic-anon-ake"
version = "0.3.2-test4"
version = "0.3.2-test5"
edition = "2021"
default-run = "generic-anon-ake"

Expand Down
14 changes: 7 additions & 7 deletions benches/performance_classic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use generic_anon_ake::classic::{

const SAMPLES: usize = 10;
const LOW_LIMIT: u32 = 6;
const UPP_LIMIT: u32 = 10; // Fix: Change to 17
const UPP_LIMIT: u32 = 11; // Fix: Change to 17
const WARMUP: u64 = 1;

fn bench_1(c: &mut Criterion) {
Expand Down Expand Up @@ -65,12 +65,12 @@ fn bench_1(c: &mut Criterion) {

let parameter_string = format!("{}", users);

let _x0 = (0, 0);
group.bench_with_input(
BenchmarkId::new("Registration", parameter_string.clone()),
&_x0,
|b, _| b.iter(|| registration(&config)),
);
// let _x0 = (0, 0);
// group.bench_with_input(
// BenchmarkId::new("Registration", parameter_string.clone()),
// &_x0,
// |b, _| b.iter(|| registration(&config)),
// );

let _x1 = (0, 0);
group.bench_with_input(
Expand Down
14 changes: 7 additions & 7 deletions benches/performance_pq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use generic_anon_ake::{

const SAMPLES: usize = 10;
const LOW_LIMIT: u32 = 6;
const UPP_LIMIT: u32 = 10; // Fix: Change to 17
const UPP_LIMIT: u32 = 11; // Fix: Change to 17
const WARMUP: u64 = 1;
const ALGS: [(&'static str, &'static str); 6] = [
("Kyber1024", "Dilithium5"),
Expand Down Expand Up @@ -82,12 +82,12 @@ fn bench_1(c: &mut Criterion) {

let parameter_string = format!("{}-{}-{}", kemalg_str, sigalg_str, users);

let _x0 = (0, 0);
group.bench_with_input(
BenchmarkId::new("Registration", parameter_string.clone()),
&_x0,
|b, _| b.iter(|| registration(&config)),
);
// let _x0 = (0, 0);
// group.bench_with_input(
// BenchmarkId::new("Registration", parameter_string.clone()),
// &_x0,
// |b, _| b.iter(|| registration(&config)),
// );

let _x1 = (0, 0);
group.bench_with_input(
Expand Down
10 changes: 6 additions & 4 deletions graphics/generate_graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,11 @@ def plot_scalability(df, df_bandwidth, output_path):

df3 = pd.merge(df2, df_bandwidth, how='left', left_on=['Algorithm', 'Clients'], right_on = ['Algorithm', 'Clients'])

sns.pointplot(ax=ax1, x="Clients", y="Time", hue="Algorithm", data=df3, palette=COLORS, dodge=True)
hue_order = ["Kyber512+Dilithium2", "Kyber768+Dilithium3", "Kyber1024+Dilithium5", 'ClassicMcEliece6960119f+Dilithium5', 'ClassicMcEliece460896f+Dilithium3', 'ClassicMcEliece348864f+Dilithium2', CLASSIC_PKE_SIG]

sns.pointplot(ax=ax1, x="Clients", y="Time", hue="Algorithm", data=df3, palette=COLORS, dodge=True, hue_order=hue_order)
ax2 = ax1.twinx()
sns.barplot(ax=ax2, x="Clients", y="Bandwidth", data=df3, hue="Algorithm", alpha=0.3)
sns.barplot(ax=ax2, x="Clients", y="Bandwidth", hue="Algorithm", data=df3, palette=COLORS, alpha=0.5, hue_order=hue_order)

ax1.set_xlabel('Number of clients', fontsize="x-large")
ax1.set_ylabel('Time (milliseconds)', fontsize="x-large")
Expand All @@ -205,7 +207,7 @@ def plot_scalability(df, df_bandwidth, output_path):
# h, l = ax1.get_legend_handles_labels()
# l, h = zip(*sorted(zip(l, h)))
# ax1.legend(h, l)
reorderLegend(ax1, ["Kyber512+Dilithium2", "Kyber768+Dilithium3", "Kyber1024+Dilithium5", 'ClassicMcEliece6960119f+Dilithium5', 'ClassicMcEliece460896f+Dilithium3', 'ClassicMcEliece348864f+Dilithium2', CLASSIC_PKE_SIG])
reorderLegend(ax1, hue_order)

figname = "{}scalability.png".format(output_path)
fig.savefig(figname, bbox_inches="tight")
Expand Down Expand Up @@ -333,7 +335,7 @@ def main():

plot_scalability(df_protocol, df_bandwidth, OUTPUT)
plot_rounds(df_protocol, OUTPUT)
plot_registration(df_protocol, OUTPUT)
#plot_registration(df_protocol, OUTPUT)

save_to_csv_primitives([OUTPUT + "PKE", OUTPUT + "SIG"], OUTPUT, "data_primitives.csv")
df_primitives = load_csv(OUTPUT, 'data_primitives.csv')
Expand Down

0 comments on commit 7002923

Please sign in to comment.