Skip to content

Commit

Permalink
Add benchmarks for semigroup methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
kindaro committed Apr 12, 2024
1 parent 495f013 commit 180645e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions benchmarks/haskell/Benchmarks/Pure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import qualified Data.Text.Encoding as T
import qualified Data.Text.Lazy as TL
import qualified Data.Text.Lazy.Builder as TB
import qualified Data.Text.Lazy.Encoding as TL
import Data.Semigroup
import Data.List.NonEmpty (NonEmpty((:|)))

data Env = Env
{ bsa :: !BS.ByteString
Expand Down Expand Up @@ -83,6 +85,14 @@ benchmark kind ~Env{..} =
[ benchT $ nf T.concat tl
, benchTL $ nf TL.concat tll
]
, bgroup "sconcat"
[ benchT $ nf sconcat (T.empty :| tl)
, benchTL $ nf sconcat (TL.empty :| tll)
]
, bgroup "stimes"
[ benchT $ nf (stimes (10 :: Int)) ta
, benchTL $ nf (stimes (10 :: Int)) tla
]
, bgroup "cons"
[ benchT $ nf (T.cons c) ta
, benchTL $ nf (TL.cons c) tla
Expand Down

0 comments on commit 180645e

Please sign in to comment.