Skip to content

Commit

Permalink
add hashlib time for comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
GiacomoPope committed Jul 27, 2024
1 parent 772b62a commit 81f1601
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions speed_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@
a = xof.read(n)
print(f"10_000 calls with class pyo3: {time.time() - t0 }")

random.seed(0)
t0 = time.time()
for _ in range(10_000):
n = random.randint(1, 5000)
a = shake_128(b"123").digest(n)
print(f"10_000 calls with hashlib: {time.time() - t0 }")

print("-" * 80)

0 comments on commit 81f1601

Please sign in to comment.