From 500a6ca99eb5b878a4d79706d48f776d2bd2b450 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Wed, 12 Jun 2019 20:17:54 -0400 Subject: Optmizations, disabled weigh benchmarking. --- test/bench.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') 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 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE ForeignFunctionInterface #-} import qualified Data.Attoparsec.Text as Atto import qualified Data.ByteString.Char8 as S @@ -24,7 +25,9 @@ import qualified Graphics.WaveFront.Parse.Common as Parse import Wavefront import Criterion.Main +#ifdef WEIGH import Weigh -- WARNING: weigh is incompatible with profiling. It reports much more allocations with profiling turned on. +#endif foreign import ccall "&cube_obj" cube_ptr :: Ptr Word8 cube_obj_len :: Int @@ -79,4 +82,10 @@ main = do , bench "sundqvist" $ whnf countVerticesSundqvist cube_objT ] ] +#ifdef WEIGH + Weigh.mainWith $ do + func "crayne" countVerticesCrayne cube_obj + func "sabadie" countVerticesSabadie cube_objT + func "sundqvist" countVerticesSundqvist cube_objT +#endif return () -- cgit v1.2.3