mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-05-27 05:15:20 +00:00
add sntrup761 benchmark
This commit is contained in:
+7
-4
@@ -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
|
||||
]
|
||||
|
||||
@@ -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)
|
||||
]
|
||||
]
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user