diff options
author | Alberto Ruiz <aruiz@um.es> | 2009-04-17 11:55:32 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2009-04-17 11:55:32 +0000 |
commit | 33a8f087574c89d257fccefd58643bd9b8fa9f22 (patch) | |
tree | f017b6834367fd1bd29d58801d10a2eebf383be3 /examples | |
parent | 71ed02d2728701130cf82e61a8633af0f6375812 (diff) |
restored C trans and constant for comparison
Diffstat (limited to 'examples')
-rw-r--r-- | examples/benchmarks.hs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/benchmarks.hs b/examples/benchmarks.hs index 4fd7a56..d7f8c40 100644 --- a/examples/benchmarks.hs +++ b/examples/benchmarks.hs | |||
@@ -18,9 +18,11 @@ time act = do | |||
18 | 18 | ||
19 | -------------------------------------------------------------------------------- | 19 | -------------------------------------------------------------------------------- |
20 | 20 | ||
21 | main = sequence_ [bench1,bench2,bench4, | 21 | main = sequence_ [bench1, |
22 | bench5 1000000 3, | 22 | bench2, |
23 | bench5 100000 50] | 23 | bench4, |
24 | bench5 1000000 3, bench5 100000 50, | ||
25 | bench6 100 (100000::Double), bench6 100000 (100::Double), bench6 10000 (1000::Double)] | ||
24 | 26 | ||
25 | w :: Vector Double | 27 | w :: Vector Double |
26 | w = constant 1 5000000 | 28 | w = constant 1 5000000 |
@@ -140,3 +142,10 @@ bench5 n d = do | |||
140 | 142 | ||
141 | timep $ foldl1' (<>) ms | 143 | timep $ foldl1' (<>) ms |
142 | timep $ foldl1' op1 ms | 144 | timep $ foldl1' op1 ms |
145 | |||
146 | -------------------------------------------------------------------------------- | ||
147 | |||
148 | bench6 sz n = do | ||
149 | putStrLn "-------------------------------------------------------" | ||
150 | putStrLn "many constants" | ||
151 | time $ print $ sum $ map ((@>0). flip constant sz) [1..n] \ No newline at end of file | ||