on master help sign in
squelch unused warnings in bigrel
commit008002237d2ab55cf5f2a31797604382dde49a8c authorAgentM <agentm@themactionfaction.com> dateSat 7 Jul 2018, 14:43 (8 years ago) parentb0fd8a3
1 file changed+15−7
src/bin/benchmark/bigrel.hs+15−7
src/bin/benchmark/bigrel.hs+15−7
@@ -6,14 +6,14 @@ import ProjectM36.DateExamples
66import ProjectM36.Error
77import qualified ProjectM36.Attribute as A
88import qualified Data.Text as T
9−import ProjectM36.Relation.Show.CSV
9+--import ProjectM36.Relation.Show.CSV
1010import ProjectM36.Relation.Show.HTML
1111import TutorialD.Interpreter.DatabaseContextExpr (interpretDatabaseContextExpr)
1212import ProjectM36.RelationalExpression
13−import qualified Data.HashSet as HS
14−import qualified Data.ByteString.Lazy.Char8 as BS
15−import qualified Data.IntMap as IM
16−import qualified Data.Hashable as Hash
13+--import qualified Data.HashSet as HS
14+--import qualified Data.ByteString.Lazy.Char8 as BS
15+--import qualified Data.IntMap as IM
16+--import qualified Data.Hashable as Hash
1717import qualified Data.Vector as V
1818import Options.Applicative
1919import qualified Data.Map as M
@@ -24,10 +24,12 @@ import Control.DeepSeq
2424import Data.Text hiding (map)
2525import Data.Monoid
2626
27+{-
2728dumpcsv :: Relation -> IO ()
2829dumpcsv rel = case relationAsCSV rel of
2930 Left err -> hPrint stderr err
3031 Right bsData -> BS.putStrLn bsData
32+-}
3133
3234data BigrelArgs = BigrelArgs Int Int Text
3335
@@ -67,14 +69,16 @@ matrixRun (BigrelArgs attributeCount tupleCount tutd) =
6769 Right context' -> TIO.putStrLn $ relationAsHTML (relationVariables context' M.! "x")
6870 Left err -> hPrint stderr err
6971
70−
72+{-
7173intmapMatrixRun :: IO ()
7274intmapMatrixRun = do
7375 let matrix = intmapMatrixRelation 100 100000
7476 print matrix
77+-}
7578
7679--compare IntMap speed and size
7780--this is about 3 times faster (9 minutes) for 10x100000 and uses 800 MB
81+{-
7882intmapMatrixRelation :: Int -> Int -> HS.HashSet (IM.IntMap Atom)
7983intmapMatrixRelation attributeCount tupleCount = HS.fromList $ map mapper [0..tupleCount]
8084 where
@@ -82,14 +86,18 @@ intmapMatrixRelation attributeCount tupleCount = HS.fromList $ map mapper [0..tu
8286
8387instance Hash.Hashable (IM.IntMap Atom) where
8488 hashWithSalt salt tupMap = Hash.hashWithSalt salt (show tupMap)
89+-}
8590
91+{-
8692vectorMatrixRun :: IO ()
8793vectorMatrixRun = do
8894 let matrix = vectorMatrixRelation 100 100000
8995 print matrix
96+-}
9097
9198-- 20 s 90 MBs- a clear win- ideal size is 10 * 100000 * 8 bytes = 80 MB! without IntAtom wrapper
9299--with IntAtom wrapper: 1m12s 90 MB
100+{-
93101vectorMatrixRelation :: Int -> Int -> HS.HashSet (V.Vector Atom)
94102vectorMatrixRelation attributeCount tupleCount = HS.fromList $ map mapper [0..tupleCount]
95103 where
@@ -97,7 +105,7 @@ vectorMatrixRelation attributeCount tupleCount = HS.fromList $ map mapper [0..tu
97105
98106instance Hash.Hashable (V.Vector Atom) where
99107 hashWithSalt salt vec = Hash.hashWithSalt salt (show vec)
100−
108+-}
101109-- returns a relation with tupleCount tuples with a set of integer attributes attributesCount long
102110-- this is useful for performance and resource usage testing
103111matrixRelation :: Int -> Int -> Either RelationalError Relation