on master help sign in
fix benchmark target
commitf155db8c77dc97fe1a911e43f8a1b21fd85948b7 authorAgentM <agentm@themactionfaction.com> dateSun 21 Aug 2016, 13:05 (10 years ago) parent668a16b
1 file changed+14
src/bin/benchmark/Relation.hs+14
src/bin/benchmark/Relation.hs+14
@@ -1,5 +1,19 @@
11import Criterion.Main
22import ProjectM36.Relation
3+import ProjectM36.Base
4+import ProjectM36.Error
5+import qualified ProjectM36.Attribute as A
6+import qualified Data.Text as T
7+import qualified Data.Vector as V
8+
9+-- returns a relation with tupleCount tuples with a set of integer attributes attributesCount long
10+-- this is useful for performance and resource usage testing
11+matrixRelation :: Int -> Int -> Either RelationalError Relation
12+matrixRelation attributeCount tupleCount = do
13+ let attrs = A.attributesFromList $ map (\c-> Attribute (T.pack $ "a" ++ show c) IntAtomType) [0 .. attributeCount-1]
14+ tuple tupleX = RelationTuple attrs (V.generate attributeCount (\_ -> IntAtom tupleX))
15+ tuples = map (\c -> tuple c) [0 .. tupleCount]
16+ mkRelationDeferVerify attrs (RelationTupleSet tuples)
317
418main :: IO ()
519main = defaultMain [