Skip to content

Commit 141449b

Browse files
authored
Add missing permutation benchmark to *-papi (#515)
A backpack, A backpack, My kingdom for a backpack!
1 parent d9d0d46 commit 141449b

File tree

1 file changed

+3
-0
lines changed
  • vector-bench-papi/benchmarks

1 file changed

+3
-0
lines changed

vector-bench-papi/benchmarks/Main.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Bench.Vector.Algo.Quickhull (quickhull)
1111
import Bench.Vector.Algo.Spectral (spectral)
1212
import Bench.Vector.Algo.Tridiag (tridiag)
1313
import Bench.Vector.Algo.FindIndexR (findIndexR, findIndexR_naive, findIndexR_manual)
14+
import Bench.Vector.Algo.NextPermutation (generatePermTests)
1415

1516
import Bench.Vector.TestData.ParenTree (parenTree)
1617
import Bench.Vector.TestData.Graph (randomGraph)
@@ -49,6 +50,7 @@ main = do
4950
!ds <- randomVector useSize
5051
!sp <- randomVector (floor $ sqrt $ fromIntegral useSize)
5152
vi <- MV.new useSize
53+
permTests <- generatePermTests gen useSize
5254

5355
defaultMainWithIngredients ingredients $ bgroup "All"
5456
[ bench "listRank" $ whnf listRank useSize
@@ -65,4 +67,5 @@ main = do
6567
, bench "findIndexR_manual" $ whnf findIndexR_manual ((<indexFindThreshold), as)
6668
, bench "minimumOn" $ whnf (U.minimumOn (\x -> x*x*x)) as
6769
, bench "maximumOn" $ whnf (U.maximumOn (\x -> x*x*x)) as
70+
, bgroup "(next|prev)Permutation" $ map (\(name, act) -> bench name $ whnfIO act) permTests
6871
]

0 commit comments

Comments
 (0)