Skip to content

Commit

Permalink
Adds throughput to benchmarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
schultz-is committed Jul 23, 2020
1 parent 31025e9 commit 36b2653
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ go tool pprof mem.prof
### 2019 MacBook Pro 2.3GHz Intel i9

```console
name time/op
Threefish256/encrypt-16 112ns ± 0%
Threefish256/decrypt-16 140ns ± 0%
Threefish512/encrypt-16 298ns ± 0%
Threefish512/decrypt-16 271ns ± 0%
Threefish1024/encrypt-16 734ns ± 0%
Threefish1024/decrypt-16 681ns ± 0%
name time/op speed
Threefish256/encrypt-16 124ns ± 0% 259MB/s ± 0%
Threefish256/decrypt-16 156ns ± 0% 206MB/s ± 0%
Threefish512/encrypt-16 338ns ± 0% 189MB/s ± 0%
Threefish512/decrypt-16 310ns ± 0% 206MB/s ± 0%
Threefish1024/encrypt-16 804ns ± 0% 159MB/s ± 0%
Threefish1024/decrypt-16 778ns ± 0% 165MB/s ± 0%
```
2 changes: 2 additions & 0 deletions threefish1024_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ func BenchmarkThreefish1024(b *testing.B) {

for n := 0; n < b.N; n++ {
block.Encrypt(ciphertext, message)
b.SetBytes(blockSize1024)
}
},
)
Expand All @@ -184,6 +185,7 @@ func BenchmarkThreefish1024(b *testing.B) {

for n := 0; n < b.N; n++ {
block.Decrypt(ciphertext, ciphertext)
b.SetBytes(blockSize1024)
}
},
)
Expand Down
2 changes: 2 additions & 0 deletions threefish256_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func BenchmarkThreefish256(b *testing.B) {

for n := 0; n < b.N; n++ {
block.Encrypt(ciphertext, message)
b.SetBytes(blockSize256)
}
},
)
Expand All @@ -183,6 +184,7 @@ func BenchmarkThreefish256(b *testing.B) {

for n := 0; n < b.N; n++ {
block.Decrypt(ciphertext, ciphertext)
b.SetBytes(blockSize256)
}
},
)
Expand Down
2 changes: 2 additions & 0 deletions threefish512_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ func BenchmarkThreefish512(b *testing.B) {

for n := 0; n < b.N; n++ {
block.Encrypt(ciphertext, message)
b.SetBytes(blockSize512)
}
},
)
Expand All @@ -184,6 +185,7 @@ func BenchmarkThreefish512(b *testing.B) {

for n := 0; n < b.N; n++ {
block.Decrypt(ciphertext, ciphertext)
b.SetBytes(blockSize512)
}
},
)
Expand Down

0 comments on commit 36b2653

Please sign in to comment.