From b1c0de99725f786a87d728f26bbb05d864920c41 Mon Sep 17 00:00:00 2001 From: Preetham Gujjula Date: Fri, 10 May 2024 16:58:28 -0700 Subject: [PATCH] Remove old applyMerge benchmarking code --- bench/Main.hs | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/bench/Main.hs b/bench/Main.hs index 7febdc5..bd149ec 100644 --- a/bench/Main.hs +++ b/bench/Main.hs @@ -3,49 +3,17 @@ module Main (main) where -import ApplyMerge.DoublyLinkedList qualified -import ApplyMerge.IntMap qualified -import ApplyMerge.IntSet qualified -import ApplyMerge.MergeAll qualified import Bench.ApplyMerge qualified import Bench.Data.DoublyLinkedList.STRef qualified import Bench.PriorityQueue.MinPQueue qualified import Bench.PriorityQueue.MinPQueue.Mutable qualified -import Data.Function ((&)) -import Test.Tasty.Bench (Benchmark, bench, bgroup, defaultMain, nf) +import Test.Tasty.Bench (defaultMain) main :: IO () main = defaultMain - [ benchCommon - "DoublyLinkedList" - ApplyMerge.DoublyLinkedList.applyMerge, - benchCommon "IntMap" ApplyMerge.IntMap.applyMerge, - benchCommon "IntSet" ApplyMerge.IntSet.applyMerge, - benchCommon "MergeAll" ApplyMerge.MergeAll.applyMerge, - Bench.ApplyMerge.benchmarks, + [ Bench.ApplyMerge.benchmarks, Bench.Data.DoublyLinkedList.STRef.benchmarks, Bench.PriorityQueue.MinPQueue.benchmarks, Bench.PriorityQueue.MinPQueue.Mutable.benchmarks ] - -benchCommon :: - String -> - (forall a b c. (Ord c) => (a -> b -> c) -> [a] -> [b] -> [c]) -> - Benchmark -benchCommon name applyMerge = - bgroup name [benchmarkSymmetric] - where - benchmarkSymmetric :: Benchmark - benchmarkSymmetric = - bgroup "benchmarkSymmetric" (fmap mkBench [1 .. (6 :: Int)]) - where - mkBench :: Int -> Benchmark - mkBench i = bench (show i) (nf collapse (10 ^ i)) - where - collapse :: Int -> Int - collapse n = - let start = (n `quot` maxBound) + 1 - in applyMerge (*) [start ..] [start ..] - & take n - & sum