diff options
Diffstat (limited to 'test/bench.hs')
-rw-r--r-- | test/bench.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/bench.hs b/test/bench.hs index 9952ec2..3125ed9 100644 --- a/test/bench.hs +++ b/test/bench.hs | |||
@@ -1,3 +1,4 @@ | |||
1 | {-# LANGUAGE CPP #-} | ||
1 | {-# LANGUAGE ForeignFunctionInterface #-} | 2 | {-# LANGUAGE ForeignFunctionInterface #-} |
2 | import qualified Data.Attoparsec.Text as Atto | 3 | import qualified Data.Attoparsec.Text as Atto |
3 | import qualified Data.ByteString.Char8 as S | 4 | import qualified Data.ByteString.Char8 as S |
@@ -24,7 +25,9 @@ import qualified Graphics.WaveFront.Parse.Common as Parse | |||
24 | import Wavefront | 25 | import Wavefront |
25 | 26 | ||
26 | import Criterion.Main | 27 | import Criterion.Main |
28 | #ifdef WEIGH | ||
27 | import Weigh -- WARNING: weigh is incompatible with profiling. It reports much more allocations with profiling turned on. | 29 | import Weigh -- WARNING: weigh is incompatible with profiling. It reports much more allocations with profiling turned on. |
30 | #endif | ||
28 | 31 | ||
29 | foreign import ccall "&cube_obj" cube_ptr :: Ptr Word8 | 32 | foreign import ccall "&cube_obj" cube_ptr :: Ptr Word8 |
30 | cube_obj_len :: Int | 33 | cube_obj_len :: Int |
@@ -79,4 +82,10 @@ main = do | |||
79 | , bench "sundqvist" $ whnf countVerticesSundqvist cube_objT | 82 | , bench "sundqvist" $ whnf countVerticesSundqvist cube_objT |
80 | ] | 83 | ] |
81 | ] | 84 | ] |
85 | #ifdef WEIGH | ||
86 | Weigh.mainWith $ do | ||
87 | func "crayne" countVerticesCrayne cube_obj | ||
88 | func "sabadie" countVerticesSabadie cube_objT | ||
89 | func "sundqvist" countVerticesSundqvist cube_objT | ||
90 | #endif | ||
82 | return () | 91 | return () |