Hello community, here is the log from the commit of package ghc-psqueues for openSUSE:Factory checked in at 2016-04-30 23:30:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-psqueues (Old) and /work/SRC/openSUSE:Factory/.ghc-psqueues.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-psqueues" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-psqueues/ghc-psqueues.changes 2016-02-11 12:37:32.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-psqueues.new/ghc-psqueues.changes 2016-04-30 23:30:28.000000000 +0200 @@ -1,0 +2,6 @@ +Tue Apr 26 08:39:18 UTC 2016 - mimi...@gmail.com + +- update to 0.2.2.1 +* Fix benchmark compilation with stack + +------------------------------------------------------------------- Old: ---- psqueues-0.2.2.0.tar.gz New: ---- psqueues-0.2.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-psqueues.spec ++++++ --- /var/tmp/diff_new_pack.UburaB/_old 2016-04-30 23:30:29.000000000 +0200 +++ /var/tmp/diff_new_pack.UburaB/_new 2016-04-30 23:30:29.000000000 +0200 @@ -20,7 +20,7 @@ %bcond_with tests Name: ghc-psqueues -Version: 0.2.2.0 +Version: 0.2.2.1 Release: 0 Summary: Pure priority search queues Group: System/Libraries ++++++ psqueues-0.2.2.0.tar.gz -> psqueues-0.2.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psqueues-0.2.2.0/CHANGELOG new/psqueues-0.2.2.1/CHANGELOG --- old/psqueues-0.2.2.0/CHANGELOG 2016-02-06 11:43:26.000000000 +0100 +++ new/psqueues-0.2.2.1/CHANGELOG 2016-04-22 12:16:55.000000000 +0200 @@ -1,3 +1,6 @@ +- 0.2.2.1 + * Fix benchmark compilation with stack + - 0.2.2.0 * Fix import of Traversable on GHC 7.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psqueues-0.2.2.0/benchmarks/BenchmarkTypes.hs new/psqueues-0.2.2.1/benchmarks/BenchmarkTypes.hs --- old/psqueues-0.2.2.0/benchmarks/BenchmarkTypes.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/psqueues-0.2.2.1/benchmarks/BenchmarkTypes.hs 2016-04-22 12:16:55.000000000 +0200 @@ -0,0 +1,28 @@ + +module BenchmarkTypes where + +import Criterion + +type BElem = (Int, Int, ()) + +data BenchmarkSet = BenchmarkSet + { bGroupName :: String + , bMinView :: Benchmarkable + , bLookup :: Benchmarkable + , bInsertEmpty :: Benchmarkable + , bInsertNew :: Benchmarkable + , bInsertDuplicates :: Benchmarkable + , bDelete :: Benchmarkable + } + +runBenchmark :: [BenchmarkSet] -> [Benchmark] +runBenchmark bset = + [ bgroup "minView" $ map (bench' bMinView) bset + , bgroup "lookup" $ map (bench' bLookup) bset + , bgroup "insertEmpty" $ map (bench' bInsertEmpty) bset + , bgroup "insertNew" $ map (bench' bInsertNew) bset + , bgroup "insertDuplicates" $ map (bench' bInsertDuplicates) bset + , bgroup "delete" $ map (bench' bDelete) bset + ] + where + bench' f x = bench (bGroupName x) (f x) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psqueues-0.2.2.0/benchmarks/Data/FingerTree/PSQueue/Benchmark.hs new/psqueues-0.2.2.1/benchmarks/Data/FingerTree/PSQueue/Benchmark.hs --- old/psqueues-0.2.2.0/benchmarks/Data/FingerTree/PSQueue/Benchmark.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/psqueues-0.2.2.1/benchmarks/Data/FingerTree/PSQueue/Benchmark.hs 2016-04-22 12:16:55.000000000 +0200 @@ -0,0 +1,61 @@ +{-# LANGUAGE BangPatterns #-} + +-- | This module contains benchmarks for the 'PSQueue' type from the +-- `fingertree-psqueue` package. +module Data.FingerTree.PSQueue.Benchmark + ( benchmark + ) where + +import Data.List (foldl') +import Data.FingerTree.PSQueue (Binding (..)) +import qualified Data.FingerTree.PSQueue as PSQueue +import Criterion.Main +import Prelude hiding (lookup) +import BenchmarkTypes +import Data.Maybe (fromMaybe) + +benchmark :: String -> [BElem] -> BenchmarkSet +benchmark name elems = BenchmarkSet + { bGroupName = name + , bMinView = whnf bench_minView initialPSQ + , bLookup = whnf (bench_lookup keys) initialPSQ + , bInsertEmpty = nf' (bench_insert firstElems) PSQueue.empty + , bInsertNew = nf' (bench_insert secondElems) initialPSQ + , bInsertDuplicates = nf' (bench_insert firstElems) initialPSQ + , bDelete = nf' (bench_delete firstKeys) initialPSQ + } + where + (firstElems, secondElems) = splitAt (numElems `div` 2) elems + numElems = length elems + keys = map (\(x, _, _) -> x) elems + firstKeys = map (\(x, _, _) -> x) firstElems + + initialPSQ :: PSQueue.PSQ Int Int + initialPSQ = PSQueue.fromList $ map toBinding firstElems + + toBinding :: BElem -> Binding Int Int + toBinding (k, p, _) = k :-> p + + -- Get the size of the resulting PSQs, since there's no NFData instance + nf' f x = whnf (PSQueue.size . f) x + +bench_lookup :: [Int] -> PSQueue.PSQ Int Int -> Int +bench_lookup xs m = foldl' (\n k -> fromMaybe n (PSQueue.lookup k m)) 0 xs + +bench_insert :: [BElem] -> PSQueue.PSQ Int Int -> PSQueue.PSQ Int Int +bench_insert xs m0 = foldl' (\m (k, p, _) -> fingerInsert k p m) m0 xs + where + fingerInsert + :: (Ord k, Ord v) => k -> v -> PSQueue.PSQ k v -> PSQueue.PSQ k v + fingerInsert k v m = PSQueue.alter (const $ Just v) k m + +bench_minView :: PSQueue.PSQ Int Int -> Int +bench_minView = go 0 + where + go !n t = case PSQueue.minView t of + Nothing -> n + Just ((k :-> x), t') -> go (n + k + x) t' + +-- Empty a queue by sequentially removing all elements +bench_delete :: [Int] -> PSQueue.PSQ Int Int -> PSQueue.PSQ Int Int +bench_delete keys t0 = foldl' (\t k -> PSQueue.delete k t) t0 keys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psqueues-0.2.2.0/benchmarks/Data/HashPSQ/Benchmark.hs new/psqueues-0.2.2.1/benchmarks/Data/HashPSQ/Benchmark.hs --- old/psqueues-0.2.2.0/benchmarks/Data/HashPSQ/Benchmark.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/psqueues-0.2.2.1/benchmarks/Data/HashPSQ/Benchmark.hs 2016-04-22 12:16:55.000000000 +0200 @@ -0,0 +1,53 @@ +{-# LANGUAGE BangPatterns #-} + +module Data.HashPSQ.Benchmark + ( benchmark + ) where + +import Data.List (foldl') +import qualified Data.HashPSQ as HashPSQ +import Criterion.Main +import Prelude hiding (lookup) +import BenchmarkTypes + +benchmark :: String -> [BElem] -> BenchmarkSet +benchmark name elems = BenchmarkSet + { bGroupName = name + , bMinView = whnf bench_minView initialPSQ + , bLookup = whnf (bench_lookup keys) initialPSQ + , bInsertEmpty = nf (bench_insert firstElems) HashPSQ.empty + , bInsertNew = nf (bench_insert secondElems) initialPSQ + , bInsertDuplicates = nf (bench_insert firstElems) initialPSQ + , bDelete = nf (bench_delete firstKeys) initialPSQ + } + where + (firstElems, secondElems) = splitAt (numElems `div` 2) elems + numElems = length elems + keys = map (\(x, _, _) -> x) elems + firstKeys = map (\(x, _, _) -> x) firstElems + + initialPSQ = HashPSQ.fromList firstElems :: HashPSQ.HashPSQ Int Int () + + +-- Get the sum of all priorities by getting all elements using 'lookup' +bench_lookup :: [Int] -> HashPSQ.HashPSQ Int Int () -> Int +bench_lookup xs m = foldl' (\n k -> maybe n fst (HashPSQ.lookup k m)) 0 xs + +-- Insert a list of elements one-by-one into a PSQ +bench_insert + :: [BElem] -> HashPSQ.HashPSQ Int Int () -> HashPSQ.HashPSQ Int Int () +bench_insert xs m0 = foldl' (\m (k, p, v) -> HashPSQ.insert k p v m) m0 xs + +-- Get the sum of all priorities by sequentially popping all elements using +-- 'minView' +bench_minView :: HashPSQ.HashPSQ Int Int () -> Int +bench_minView = go 0 + where + go !n t = case HashPSQ.minView t of + Nothing -> n + Just (k, x, _, t') -> go (n + k + x) t' + +-- Empty a queue by sequentially removing all elements +bench_delete + :: [Int] -> HashPSQ.HashPSQ Int Int () -> HashPSQ.HashPSQ Int Int () +bench_delete keys t0 = foldl' (\t k -> HashPSQ.delete k t) t0 keys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psqueues-0.2.2.0/benchmarks/Data/IntPSQ/Benchmark.hs new/psqueues-0.2.2.1/benchmarks/Data/IntPSQ/Benchmark.hs --- old/psqueues-0.2.2.0/benchmarks/Data/IntPSQ/Benchmark.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/psqueues-0.2.2.1/benchmarks/Data/IntPSQ/Benchmark.hs 2016-04-22 12:16:55.000000000 +0200 @@ -0,0 +1,50 @@ +{-# LANGUAGE BangPatterns #-} +module Data.IntPSQ.Benchmark + ( benchmark + ) where + +import Data.List (foldl') +import qualified Data.IntPSQ as IntPSQ +import Criterion.Main +import Prelude hiding (lookup) +import BenchmarkTypes + +benchmark :: String -> [BElem] -> BenchmarkSet +benchmark name elems = BenchmarkSet + { bGroupName = name + , bMinView = whnf bench_minView initialPSQ + , bLookup = whnf (bench_lookup keys) initialPSQ + , bInsertEmpty = nf (bench_insert firstElems) IntPSQ.empty + , bInsertNew = nf (bench_insert secondElems) initialPSQ + , bInsertDuplicates = nf (bench_insert firstElems) initialPSQ + , bDelete = nf (bench_delete firstKeys) initialPSQ + } + where + (firstElems, secondElems) = splitAt (numElems `div` 2) elems + numElems = length elems + keys = map (\(x, _, _) -> x) elems + firstKeys = map (\(x, _, _) -> x) firstElems + + initialPSQ = IntPSQ.fromList firstElems :: IntPSQ.IntPSQ Int () + +-- Get the sum of all priorities by getting all elements using 'lookup' +bench_lookup :: [Int] -> IntPSQ.IntPSQ Int () -> Int +bench_lookup xs m = foldl' (\n k -> maybe n fst (IntPSQ.lookup k m)) 0 xs + +-- Insert a list of elements one-by-one into a PSQ +bench_insert + :: [(Int, Int, ())] -> IntPSQ.IntPSQ Int () -> IntPSQ.IntPSQ Int () +bench_insert xs m0 = foldl' (\m (k, p, v) -> IntPSQ.insert k p v m) m0 xs + +-- Get the sum of all priorities by sequentially popping all elements using +-- 'minView' +bench_minView :: IntPSQ.IntPSQ Int () -> Int +bench_minView = go 0 + where + go !n t = case IntPSQ.minView t of + Nothing -> n + Just (k, p, _, t') -> go (n + k + p) t' + +-- Empty a queue by sequentially removing all elements +bench_delete :: [Int] -> IntPSQ.IntPSQ Int () -> IntPSQ.IntPSQ Int () +bench_delete keys t0 = foldl' (\t k -> IntPSQ.delete k t) t0 keys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psqueues-0.2.2.0/benchmarks/Data/OrdPSQ/Benchmark.hs new/psqueues-0.2.2.1/benchmarks/Data/OrdPSQ/Benchmark.hs --- old/psqueues-0.2.2.0/benchmarks/Data/OrdPSQ/Benchmark.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/psqueues-0.2.2.1/benchmarks/Data/OrdPSQ/Benchmark.hs 2016-04-22 12:16:55.000000000 +0200 @@ -0,0 +1,49 @@ +{-# LANGUAGE BangPatterns #-} +module Data.OrdPSQ.Benchmark + ( benchmark + ) where + +import Data.List (foldl') +import qualified Data.OrdPSQ as OrdPSQ +import Criterion.Main +import Prelude hiding (lookup) +import BenchmarkTypes + +benchmark :: String -> [BElem] -> BenchmarkSet +benchmark name elems = BenchmarkSet + { bGroupName = name + , bMinView = whnf bench_minView initialPSQ + , bLookup = whnf (bench_lookup keys) initialPSQ + , bInsertEmpty = nf (bench_insert firstElems) OrdPSQ.empty + , bInsertNew = nf (bench_insert secondElems) initialPSQ + , bInsertDuplicates = nf (bench_insert firstElems) initialPSQ + , bDelete = nf (bench_delete firstKeys) initialPSQ + } + where + (firstElems, secondElems) = splitAt (numElems `div` 2) elems + numElems = length elems + keys = map (\(x, _, _) -> x) elems + firstKeys = map (\(x, _, _) -> x) firstElems + + initialPSQ = OrdPSQ.fromList firstElems :: OrdPSQ.OrdPSQ Int Int () + +-- Get the sum of all priorities by getting all elements using 'lookup' +bench_lookup :: [Int] -> OrdPSQ.OrdPSQ Int Int () -> Int +bench_lookup xs m = foldl' (\n k -> maybe n fst (OrdPSQ.lookup k m)) 0 xs + +-- Insert a list of elements one-by-one into a PSQ +bench_insert :: [BElem] -> OrdPSQ.OrdPSQ Int Int () -> OrdPSQ.OrdPSQ Int Int () +bench_insert xs m0 = foldl' (\m (k, p, v) -> OrdPSQ.insert k p v m) m0 xs + +-- Get the sum of all priorities by sequentially popping all elements using +-- 'minView' +bench_minView :: OrdPSQ.OrdPSQ Int Int () -> Int +bench_minView = go 0 + where + go !n t = case OrdPSQ.minView t of + Nothing -> n + Just (k, x, _, t') -> go (n + k + x) t' + +-- Empty a queue by sequentially removing all elements +bench_delete :: [Int] -> OrdPSQ.OrdPSQ Int Int () -> OrdPSQ.OrdPSQ Int Int () +bench_delete keys t0 = foldl' (\t k -> OrdPSQ.delete k t) t0 keys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psqueues-0.2.2.0/benchmarks/Data/PSQueue/Benchmark.hs new/psqueues-0.2.2.1/benchmarks/Data/PSQueue/Benchmark.hs --- old/psqueues-0.2.2.0/benchmarks/Data/PSQueue/Benchmark.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/psqueues-0.2.2.1/benchmarks/Data/PSQueue/Benchmark.hs 2016-04-22 12:16:55.000000000 +0200 @@ -0,0 +1,60 @@ +{-# LANGUAGE BangPatterns #-} + +-- | This module provides benchmarks for the 'PSQueue' type from the PSQueue +-- package. +module Data.PSQueue.Benchmark + ( benchmark + ) where + +import Data.List (foldl') +import qualified Data.PSQueue as PSQueue +import Criterion.Main +import Prelude hiding (lookup) +import BenchmarkTypes +import Data.Maybe (fromMaybe) + +benchmark :: String -> [BElem] -> BenchmarkSet +benchmark name elems = BenchmarkSet + { bGroupName = name + , bMinView = whnf bench_minView initialPSQ + , bLookup = whnf (bench_lookup keys) initialPSQ + , bInsertEmpty = nf' (bench_insert firstElems) PSQueue.empty + , bInsertNew = nf' (bench_insert secondElems) initialPSQ + , bInsertDuplicates = nf' (bench_insert firstElems) initialPSQ + , bDelete = nf' (bench_delete firstKeys) initialPSQ + } + where + (firstElems, secondElems) = splitAt (numElems `div` 2) elems + numElems = length elems + keys = map (\(x, _, _) -> x) elems + firstKeys = map (\(x, _, _) -> x) firstElems + + initialPSQ + = PSQueue.fromList $ map toBinding firstElems :: PSQueue.PSQ Int Int + + toBinding :: BElem -> PSQueue.Binding Int Int + toBinding (k, p, _) = k PSQueue.:-> p + + -- Get the size of the resulting PSQ, since there's no NFData instance. + nf' f x = whnf (PSQueue.size . f) x + +-- Get the sum of all priorities by getting all elements using 'lookup' +bench_lookup :: [Int] -> PSQueue.PSQ Int Int -> Int +bench_lookup xs m = foldl' (\n k -> fromMaybe n (PSQueue.lookup k m)) 0 xs + +-- Insert a list of elements one-by-one into a PSQ +bench_insert :: [BElem] -> PSQueue.PSQ Int Int -> PSQueue.PSQ Int Int +bench_insert xs m0 = foldl' (\m (k, p, _) -> PSQueue.insert k p m) m0 xs + +-- Get the sum of all priorities by sequentially popping all elements using +-- 'minView' +bench_minView :: PSQueue.PSQ Int Int -> Int +bench_minView = go 0 + where + go !n t = case PSQueue.minView t of + Nothing -> n + Just ((k PSQueue.:-> x), t') -> go (n + k + x) t' + +-- Empty a queue by sequentially removing all elements +bench_delete :: [Int] -> PSQueue.PSQ Int Int -> PSQueue.PSQ Int Int +bench_delete keys t0 = foldl' (\t k -> PSQueue.delete k t) t0 keys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psqueues-0.2.2.0/psqueues.cabal new/psqueues-0.2.2.1/psqueues.cabal --- old/psqueues-0.2.2.0/psqueues.cabal 2016-02-06 11:43:26.000000000 +0100 +++ new/psqueues-0.2.2.1/psqueues.cabal 2016-04-22 12:16:55.000000000 +0200 @@ -1,5 +1,5 @@ Name: psqueues -Version: 0.2.2.0 +Version: 0.2.2.1 License: BSD3 License-file: LICENSE Maintainer: Jasper Van der Jeugt <jasper...@gmail.com> @@ -85,6 +85,15 @@ Type: exitcode-stdio-1.0 Hs-source-dirs: src benchmarks Main-is: Main.hs + + Other-modules: + BenchmarkTypes + Data.FingerTree.PSQueue.Benchmark + Data.HashPSQ.Benchmark + Data.IntPSQ.Benchmark + Data.OrdPSQ.Benchmark + Data.PSQueue.Benchmark + Ghc-options: -Wall Build-depends: