Skip to content

Commit

Permalink
Add --help flag and use larger sets for benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly committed May 13, 2024
1 parent 9856a25 commit 2efa707
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion alba-bench.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ parseCommand = \case
Prove <$> parseOptions rest
("verify" : rest) ->
Verify <$> parseOptions rest
("--help" : _) ->
usage >> exitWith ExitSuccess
other ->
exitWith (ExitFailure 1)

Expand Down
6 changes: 3 additions & 3 deletions bench/ALBABench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ main :: IO ()
main = do
benches <-
forM
[ (s_p, len) | s_p <- [100, 200, 300], len <- [64, 128, 256]
[ (s_p, len) | s_p <- [500, 1000 .. 10000], let len = 256
]
genItems
defaultMain
[ bgroup "Hashing" [benchHash testBytes]
, bgroup
"Proof Generation"
$ [benchProof (b, λ) | b <- benches, λ <- [10, 64, 128]]
$ [benchProof (b, λ) | b <- benches, let λ = 128]
]

benchHash :: ByteString -> Benchmark
Expand All @@ -31,7 +31,7 @@ benchProof :: ([ByteString], Integer) -> Benchmark
benchProof (bytes, λ) =
let coeff = fromIntegral $ length bytes
params = Params λ λ (coeff * 8 `div` 10) (coeff * 2 `div` 10)
label = "Proving " <> show coeff <> "/" <> show (BS.length $ head bytes) <> " (Params: " <> show params <> ")"
label = show coeff <> "/" <> show (BS.length $ head bytes)

Check warning on line 34 in bench/ALBABench.hs

View workflow job for this annotation

GitHub Actions / build

In the use of ‘head’
in bench label $
whnf
(uncurry prove)
Expand Down

0 comments on commit 2efa707

Please sign in to comment.