add sntrup761 benchmark

This commit is contained in:
Alexander Bondarenko
2024-02-29 16:23:10 +02:00
parent 5baffbb370
commit e727090020
3 changed files with 23 additions and 4 deletions
+7 -4
View File
@@ -8,10 +8,13 @@ Pick one or group: cabal bench -O2 simplexmq-bench --benchmark-options "-p TRcvQ
module Main where
import Test.Tasty.Bench
import Bench.SNTRUP761
import Bench.TRcvQueues
import Test.Tasty.Bench
main :: IO ()
main = defaultMain
[ bgroup "TRcvQueues" benchTRcvQueues
]
main =
defaultMain
[ bgroup "TRcvQueues" benchTRcvQueues,
bgroup "SNTRUP761" benchSNTRUP761
]
+15
View File
@@ -0,0 +1,15 @@
module Bench.SNTRUP761 where
import qualified Simplex.Messaging.Crypto as C
import Simplex.Messaging.Crypto.SNTRUP761.Bindings
import Test.Tasty.Bench
import Test.Tasty (withResource)
benchSNTRUP761 :: [Benchmark]
benchSNTRUP761 =
[ bgroup
"sntrup761Keypair"
[ withResource C.newRandom (\_ -> pure ()) $ bench "current" . whnfAppIO (>>= sntrup761Keypair)
]
]
+1
View File
@@ -720,6 +720,7 @@ benchmark simplexmq-bench
type: exitcode-stdio-1.0
main-is: Bench.hs
other-modules:
Bench.SNTRUP761
Bench.TRcvQueues
Paths_simplexmq
hs-source-dirs: