Skip to content

Commit

Permalink
benchmark: also report the inverse of the performance (ops/s)
Browse files Browse the repository at this point in the history
Signed-off-by: Hubert Kario <[email protected]>
  • Loading branch information
tomato42 committed Jul 18, 2024
1 parent 01d7a28 commit bcb4c46
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions benchmark_kyber.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ def benchmark_kyber(Kyber, name, count):
t2 = time()
dec = Kyber.dec(c, sk)
dec_times.append(time() - t2)

print(f"Keygen: {round(sum(keygen_times),3)}")
print(f"Enc: {round(sum(enc_times), 3)}")
print(f"Dec: {round(sum(dec_times),3)}")



total_keygen = sum(keygen_times)
total_enc = sum(enc_times)
total_dec = sum(dec_times)
print(f"Keygen: {round(total_keygen, 3)} s "
f"({round(count/total_keygen, 3)}/s)")
print(f"Enc: {round(total_enc, 3)} s "
f"({round(count/total_enc, 3)}/s)")
print(f"Dec: {round(total_enc, 3)} s "
f"({round(count/total_dec, 3)})")


if __name__ == '__main__':
# profile_kyber(Kyber512)
# profile_kyber(Kyber768)
Expand All @@ -49,4 +55,4 @@ def benchmark_kyber(Kyber, name, count):
count = 1000
benchmark_kyber(Kyber512, "Kyber512", count)
benchmark_kyber(Kyber768, "Kyber768", count)
benchmark_kyber(Kyber1024, "Kyber1024", count)
benchmark_kyber(Kyber1024, "Kyber1024", count)

0 comments on commit bcb4c46

Please sign in to comment.